-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
172 lines (172 loc) · 4.53 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
module.exports = {
// 全局变量
"globals": {
"$": true,
"_": true,
"__dirname": true,
"angular": true,
"cordova": true,
"StatusBar": true
},
"root": true,
// 语言环境选项
"env": {
"node": true,
"browser": true,
"commonjs": true,
"es6": true,
"jquery": true
},
// 扩展设置文件
// 可以从插件中获取布局结构
// 可以自定义布局结构文件
// 可以使用"eslint:all"来让当前安装的eslint的所有核心规则生效
"extends": [
"eslint:recommended",
// "eslint:all,"
// "standard,"
// "vue,"
// "plugin:react/recommended,"
],
// 解析器选择,默认为Espree解析器,不建议修改
// 可选择的解析器有“esprima”,"babel-eslint"
// "parser": "",
// 解析器选项
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"generators": true,
"experimentalObjectRestSpread": true
}
},
// 第三方插件
"plugins": [
// "import",
// "babel",
// "vue",
// "eslint-plugin-html"
],
// 语法规则
"rules": {
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"off",
"double"
],
"semi": [
"error",
"always"
],
"no-redeclare": 0,
"accessor-pairs": 2,
"arrow-spacing": 2,
"block-scoped-var": 2,
"computed-property-spacing": 2,
"default-case": 2,
"dot-location": [
2,
"property"
],
"eqeqeq": [
1,
"smart"
],
"func-style": [2, "declaration", {
"allowArrowFunctions": true
}],
"indent": [0, 2, {
"SwitchCase": 0
}],
// "space-before-function-paren": ["off", {
// "anonymous": "always",
// "named": "ignore",
// "asyncArrow": "ignore"
// }],
"no-unused-vars": [0, {
"vars": "all",
"args": "after-used"
}],
"func-style": 0,
"max-depth": 2,
"max-params": [2, 15],
"new-parens": 2,
"no-alert": 1,
"no-array-constructor": 2,
"no-bitwise": 2,
"no-caller": 2,
"no-confusing-arrow": 2,
"no-console": 0,
"no-div-regex": 2,
"no-duplicate-imports": 2,
"no-else-return": 2,
"no-empty-label": 0,
"no-empty": 0,
"no-eval": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
"no-extra-parens": 2,
"no-floating-decimal": 2,
"no-implied-eval": 2,
"no-inline-comments": 2,
"no-iterator": 2,
"no-lone-blocks": 2,
"no-loop-func": 2,
"no-mixed-requires": 2,
"no-nested-ternary": 2,
"no-new-func": 2,
"no-new-object": 2,
"no-new-require": 2,
"no-new-wrappers": 2,
"no-new": 2,
"no-octal-escape": 2,
"no-path-concat": 2,
"no-proto": 2,
"no-restricted-modules": 2,
"no-return-assign": 2,
"no-self-compare": 2,
"no-sequences": 2,
"no-shadow-restricted-names": 2,
"no-this-before-super": 2,
"no-throw-literal": 2,
"no-trailing-spaces": 2,
"no-undef-init": 2,
"no-unneeded-ternary": 2,
"no-unused-expressions": 2,
"no-use-before-define": 2,
"no-useless-call": 2,
"no-useless-concat": 2,
"no-void": 2,
"object-shorthand": 0,
"operator-assignment": 2,
"operator-linebreak": 0,
"prefer-const": 0,
"prefer-spread": 2,
"radix": 2,
"sort-vars": 2,
"valid-jsdoc": 2,
"wrap-regex": 2,
"no-use-before-define": 1,
"no-loop-func": 1,
"no-var": 0
// "babel/arrow-parens": [2, "as-needed"],
// "babel/generator-star-spacing": [2, "before"]
},
// "settings": {
// "import/ignore": [
// "node_modules",
// "\\.(json|css|less|scss|jpg|png|gif|eot|svg|ttf|woff|woff2|mp4|webm)$",
// "\\.eslintrc"
// ],
// "import/extensions": [".js", ".vue"],
// "import/resolver": {
// "node": {
// "extensions": [".js", ".json"]
// }
// }
// },
};