forked from changfuguo/webpack4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
54 lines (53 loc) · 1.45 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
const isDev = process.env.NODE_ENV === 'production';
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
},
// extends: 'standard',
plugins:[
'html'
],
globals: { // 声明在代码中自定义的全局变量
"todos_lib": true,
"document": true,
"navigator": true,
"window": true
},
env: {
"browser": true,
"es6": true,
"node": true
},
rules: {
"indent": ['error', 4],
"no-cond-assign": 2,
"no-dupe-args": 2,
"no-debugger": (isDev ? 0 : 2),
"no-console": 0,
"no-unused-vars": 0, //确实会有一些变量定义了但是没用到
"no-empty": 2,
"no-func-assign": 2,
"no-process-env ": 0,
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
// "no-unreachable": 2,
"no-alert": 0,
"camelcase": [2, {"properties": "always"}], //强制驼峰命名
"arrow-parens": 0,
"arrow-spacing": [2, { "before": true, "after": true }],
"array-bracket-spacing": [2, "never"],
"block-spacing": [2, "always"],
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
"comma-dangle": [2, "never"],
"comma-spacing": [2, { "before": false, "after": true }],
"comma-style": [2, "last"],
'no-debugger': (isDev ? 0 : 2),
'semi': [1, 'always']
}
}