Skip to content

Commit 017de36

Browse files
author
p_zxxuzhang
committed
hi, lulu
hi, lulu
0 parents  commit 017de36

File tree

400 files changed

+61952
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

400 files changed

+61952
-0
lines changed

.eslintrc.json

+214
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"amd": true
5+
},
6+
"globals": {
7+
"define": true,
8+
"$": true,
9+
"console": true
10+
},
11+
"parserOptions": {
12+
"sourceType": "module"
13+
},
14+
"extends": [
15+
"eslint:recommended"
16+
],
17+
"rules": {
18+
"no-console": 1,
19+
//if, while等条件中不允许使用“=”
20+
"no-cond-assign": [2, "always"],
21+
// 禁止在条件中使用常量表达式
22+
// if (false) {
23+
// doSomethingUnfinished();
24+
// } //cuowu
25+
"no-constant-condition": 2,
26+
// 程序中不能出现debugger
27+
"no-debugger": 2,
28+
// 函数的参数名称不能重复
29+
"no-dupe-args": 2,
30+
// 对象的属性名称不能重复
31+
"no-dupe-keys": 2,
32+
// switch的case不能重复
33+
"no-duplicate-case": 2,
34+
// 禁止对 function 声明重新赋值
35+
"no-func-assign": 2,
36+
// 禁止把全局对象 (Math 和 JSON) 作为函数调用 错误:var math = Math();
37+
"no-obj-calls": 2,
38+
// 禁止正则表达式字面量中出现多个空格
39+
"no-regex-spaces": 2,
40+
"no-control-regex": 0,
41+
// 禁用稀疏数组
42+
"no-sparse-arrays": 2,
43+
// 禁止出现令人困惑的多行表达式
44+
"no-unexpected-multiline": 2,
45+
// 禁止在return、throw、continue 和 break语句之后出现不可达代码
46+
"no-unreachable": 2,
47+
// 要求使用 isNaN() 检查 NaN
48+
"use-isnan": 2,
49+
// 强制 typeof 表达式与有效的字符串进行比较
50+
// typeof foo === "undefimed" 错误
51+
"valid-typeof": 2,
52+
// 使用 === 替代 == allow-null允许null和undefined==
53+
// 禁用 arguments.caller 或 arguments.callee
54+
"no-caller": 2,
55+
// 禁止在没有类型检查操作符的情况下与 null 进行比较
56+
"no-eq-null": 1,
57+
// 禁用 eval()
58+
"no-eval": 2,
59+
// 禁止扩展原生类型
60+
"no-extend-native": 0,
61+
// 禁止不必要的 .bind() 调用
62+
"no-extra-bind": 2,
63+
//禁止不必要的bool转换
64+
"no-extra-boolean-cast": 2,
65+
//禁止多余的冒号
66+
"no-extra-semi": 2,
67+
//禁止switch穿透
68+
"no-fallthrough": 1,
69+
//禁止省略浮点数中的0 .5 3.
70+
"no-floating-decimal": 2,
71+
//禁止重复的函数声明
72+
"no-func-assign": 2,
73+
// 禁用不必要的标签
74+
"no-extra-label": 2,
75+
// 禁止使用 var 多次声明同一变量
76+
"no-redeclare": 2,
77+
// 禁用未声明的变量,除非它们在 /*global */ 注释中被提到
78+
"no-undef": 2,
79+
// 禁止出现未使用过的变量
80+
"no-unused-vars": 1,
81+
// 不允许在变量定义之前使用它们
82+
"no-use-before-define": 0,
83+
// 数组和对象键值对最后一个逗号, never参数:不能带末尾的逗号, always参数:必须带末尾的逗号,
84+
// always-multiline:多行模式必须带逗号,单行模式不能带逗号
85+
"comma-dangle": [1, "never"],
86+
// 禁止修改 const 声明的变量
87+
"no-const-assign": 2,
88+
// 禁止类成员中出现重复的名称
89+
"no-dupe-class-members": 2,
90+
// 禁止 if 作为唯一的语句出现在 else 语句中
91+
"no-lonely-if": 1,
92+
// 禁止 if 语句中有 return 之后有 else
93+
"no-else-return": 1,
94+
"array-bracket-spacing": [2, "never"],
95+
// 禁止或强制在单行代码块中使用空格(禁用)
96+
"block-spacing": [1, "never"],
97+
// 强制使用一致的缩进 第二个参数为 "tab" 时,会使用tab
98+
// 为数值,表示缩进空格数
99+
"indent": [2, 4, {
100+
"SwitchCase": 1
101+
}],
102+
// if while function 后面的{必须与if在同一行,java风格。
103+
"brace-style": [2, "1tbs", {
104+
"allowSingleLine": true
105+
}],
106+
// 双峰驼命名格式
107+
"camelcase": 2,
108+
// 控制逗号前后的空格
109+
"comma-spacing": [2, {
110+
"before": false,
111+
"after": true
112+
}],
113+
// 控制逗号在行尾出现还是在行首出现 (默认行尾)
114+
// http://eslint.org/docs/rules/comma-style
115+
"comma-style": [2, "last"],
116+
//"SwitchCase" (默认:0) 强制 switch 语句中的 case 子句的缩进水平
117+
// 以方括号取对象属性时,[ 后面和 ] 前面是否需要空格, 可选参数 never, always
118+
"computed-property-spacing": [2, "never"],
119+
// 强制使用命名的 function 表达式
120+
"func-names": 0,
121+
// 文件末尾强制换行
122+
"eol-last": 2,
123+
// 强制在对象字面量的属性中键和值之间使用一致的间距
124+
"key-spacing": [2, {
125+
"beforeColon": false,
126+
"afterColon": true
127+
}],
128+
// 强制使用一致的换行风格
129+
"linebreak-style": [1, "unix"],
130+
// 要求在注释周围有空行 ( 要求在块级注释之前有一空行)
131+
"lines-around-comment": [1, {
132+
"beforeBlockComment": true
133+
}],
134+
135+
// 要求构造函数首字母大写 (要求调用 new 操作符时有首字母大小的函数,允许调用首字母大写的函数时没有 new 操作符。)
136+
"new-cap": [2, {
137+
"newIsCap": true,
138+
"capIsNew": false
139+
}],
140+
// 要求调用无参构造函数时有圆括号
141+
"new-parens": 2,
142+
143+
// 禁止使用 Array 构造函数
144+
"no-array-constructor": 2,
145+
// 禁用按位运算符
146+
"no-bitwise": 2,
147+
// 要求 return 语句之前有一空行
148+
// "newline-before-return": 1,
149+
// 禁止在代码行后使用内联注释
150+
"no-inline-comments": 1,
151+
152+
// 禁止混合使用不同的操作符
153+
"no-mixed-operators": 0,
154+
// 不允许空格和 tab 混合缩进
155+
"no-mixed-spaces-and-tabs": 2,
156+
// 不允许多个空行
157+
"no-multiple-empty-lines": [2, {
158+
"max": 2
159+
}],
160+
161+
// 不允许使用嵌套的三元表达式
162+
"no-nested-ternary": 2,
163+
// 禁止使用 Object 的构造函数
164+
"no-new-object": 2,
165+
// 禁止使用特定的语法
166+
"no-restricted-syntax": 0,
167+
// 禁止 function 标识符和括号之间出现空格
168+
"no-spaced-func": 2,
169+
// 禁用行尾空格
170+
"no-trailing-spaces": 2,
171+
// 禁止可以在有更简单的可替代的表达式时使用三元操作符
172+
"no-unneeded-ternary": 2,
173+
// 禁止属性前有空白
174+
"no-whitespace-before-property": 0,
175+
// 强制在花括号中使用一致的空格
176+
"object-curly-spacing": 2,
177+
// 强制将对象的属性放在不同的行上
178+
"object-property-newline": 2,
179+
// 强制函数中的变量要么一起声明要么分开声明
180+
"one-var": [2, {
181+
"initialized": "never"
182+
}],
183+
// 要求或禁止在 var 声明周围换行
184+
"one-var-declaration-per-line": 1,
185+
// 强制操作符使用一致的换行符
186+
"operator-linebreak": [2, "after", {
187+
"overrides": {
188+
"?": "before",
189+
":": "before"
190+
}
191+
}],
192+
// 强制使用一致的反勾号、双引号或单引号
193+
"quotes": [2, "single", "avoid-escape"],
194+
// 要求使用 JSDoc 注释
195+
"require-jsdoc": 1,
196+
// 要求或禁止使用分号而不是 ASI(这个才是控制行尾部分号的,)
197+
"semi": [2, "always"],
198+
// 强制分号之前和之后使用一致的空格
199+
"semi-spacing": 0,
200+
// 强制在块之前使用一致的空格
201+
"space-before-blocks": [2, "always"],
202+
// 强制在 function的左括号之前使用一致的空格
203+
"space-before-function-paren": [0, "always"],
204+
// 强制在圆括号内使用一致的空格
205+
"space-in-parens": [2, "never"],
206+
// 要求操作符周围有空格
207+
"space-infix-ops": 1,
208+
// 强制在一元操作符前后使用一致的空格
209+
"space-unary-ops": [2, {
210+
"words": true,
211+
"nonwords": false
212+
}]
213+
}
214+
}

.gitignore

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
6+
# Runtime data
7+
pids
8+
*.pid
9+
*.seed
10+
11+
# Directory for instrumented libs generated by jscoverage/JSCover
12+
lib-cov
13+
14+
# Coverage directory used by tools like istanbul
15+
coverage
16+
17+
# nyc test coverage
18+
.nyc_output
19+
20+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
21+
.grunt
22+
23+
# node-waf configuration
24+
.lock-wscript
25+
26+
# Compiled binary addons (http://nodejs.org/api/addons.html)
27+
build/Release
28+
29+
# Dependency directories
30+
node_modules
31+
jspm_packages
32+
33+
# Optional npm cache directory
34+
.npm
35+
36+
# Optional REPL history
37+
.node_repl_history

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 阅文前端
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

gulpfile.js

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
var gulp = require('gulp');
2+
var sass = require('gulp-sass');
3+
//清空文件
4+
var clean = require('gulp-clean');
5+
6+
// 或者之前的modern
7+
var theme = 'peak';
8+
9+
var path = {
10+
'sass': './theme/' + theme + '/sass',
11+
'css': './theme/' + theme + '/css',
12+
'js': './theme/' + theme + '/js'
13+
};
14+
15+
// 清空CSS
16+
gulp.task('clean', function() {
17+
gulp.src([path.css + '/**/*.css'], {read: false})
18+
.pipe(clean());
19+
});
20+
21+
// 默认任务
22+
gulp.task('default', ['clean'], function () {
23+
gulp.start('sass:ui', 'sass:common', 'sass:comp', 'sass:watch');
24+
});
25+
26+
27+
gulp.task('sass:ui', function () {
28+
console.log('编译sass:ui');
29+
30+
return gulp.src(path.sass + '/common/ui/*.scss')
31+
.pipe(sass().on('error', sass.logError))
32+
.pipe(gulp.dest(path.css + '/common/ui'));
33+
});
34+
35+
gulp.task('sass:common', function () {
36+
console.log('编译sass:common');
37+
38+
return gulp.src(path.sass + '/common/!(variable)*.scss')
39+
.pipe(sass().on('error', sass.logError))
40+
.pipe(gulp.dest(path.css + '/common'));
41+
});
42+
43+
gulp.task('sass:comp', function () {
44+
console.log('编译sass:comp');
45+
46+
return gulp.src(path.sass + '/common/comp/*.scss')
47+
.pipe(sass().on('error', sass.logError))
48+
.pipe(gulp.dest(path.css + '/common/comp'));
49+
});
50+
51+
gulp.task('sass:watch', function () {
52+
gulp.watch('./theme/' + theme + '/sass/**/*.scss', ['sass:ui', 'sass:common', 'sass:comp']);
53+
});

package.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "gulps",
3+
"version": "3.9.1",
4+
"description": "LuLu UI",
5+
"main": "mockup/index.php",
6+
"directories": {
7+
"doc": "mockup"
8+
},
9+
"author": "zhangxinxu",
10+
"license": "ISC",
11+
"devDependencies": {
12+
"gulp": "^3.9.1",
13+
"gulp-clean": "^0.3.2",
14+
"gulp-sass": "^3.1.0",
15+
"gulp-ruby-sass": "^2.1.1",
16+
"gulp-util": "^3.0.7"
17+
}
18+
}

0 commit comments

Comments
 (0)