@houheaven/eslint-config-helper 2.1.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +155 -149
- package/exports.js +26 -0
- package/lib/html.js +88 -13
- package/lib/javascript-es5.js +43 -10
- package/lib/javascript-es6.js +51 -11
- package/lib/supports/support-es5.js +25 -0
- package/lib/supports/support-es6.js +35 -0
- package/lib/supports/support-html.js +41 -0
- package/lib/{support/import-support.js → supports/support-import.js} +16 -11
- package/lib/supports/support-typescript.js +34 -0
- package/lib/supports/support-vue2.js +46 -0
- package/lib/supports/support-vue3-ts.js +65 -0
- package/lib/supports/support-vue3.js +46 -0
- package/lib/typescript.js +54 -24
- package/lib/vue2.js +51 -13
- package/lib/vue3.js +95 -14
- package/node_modules/@houheaven/eslint-config-helper-core/rules/eslint/layout-formatting.js +0 -15
- package/node_modules/@houheaven/eslint-config-helper-core/rules/eslint/stylistic.js +24 -0
- package/node_modules/@houheaven/eslint-config-helper-core/utils/utils.js +1 -0
- package/package.json +17 -43
- package/lib/configs/format-prettier.js +0 -478
- package/lib/format-es5.js +0 -23
- package/lib/format-es6.js +0 -25
- package/lib/format-html.js +0 -23
- package/lib/format-import.js +0 -23
- package/lib/format-typescript.js +0 -28
- package/lib/format-vue2.js +0 -23
- package/lib/format-vue3.js +0 -23
- package/lib/import.js +0 -26
- package/lib/support/es5-support.js +0 -29
- package/lib/support/es6-support.js +0 -39
- package/lib/support/html-support.js +0 -38
- package/lib/support/import-bugfix.js +0 -65
- package/lib/support/typescript-support.js +0 -27
- package/lib/support/vue2-support.js +0 -43
- package/lib/support/vue3-support.js +0 -43
- package/lib/support/vue3-ts-support.js +0 -51
- package/lib/utils/utils.js +0 -2
- package/lib/vue3-ts.js +0 -32
package/package.json
CHANGED
|
@@ -1,46 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@houheaven/eslint-config-helper",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Eslint 规则助手",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "Eslint 规则助手 (Flat Config)",
|
|
5
5
|
"author": "立树",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"private": false,
|
|
8
|
+
"type": "module",
|
|
8
9
|
"publishConfig": {
|
|
9
10
|
"access": "public",
|
|
10
|
-
"tag": "
|
|
11
|
+
"tag": "next"
|
|
11
12
|
},
|
|
12
13
|
"keywords": [
|
|
13
14
|
"houheaven",
|
|
14
15
|
"eslint",
|
|
15
16
|
"eslint-config-helper"
|
|
16
17
|
],
|
|
17
|
-
"main": "
|
|
18
|
+
"main": "./exports.js",
|
|
18
19
|
"exports": {
|
|
19
|
-
".": "./
|
|
20
|
-
"./es6": "./lib/javascript-es6.js",
|
|
21
|
-
"./es5": "./lib/javascript-es5.js",
|
|
22
|
-
"./typescript": "./lib/typescript.js",
|
|
23
|
-
"./import": "./lib/import.js",
|
|
24
|
-
"./vue2": "./lib/vue2.js",
|
|
25
|
-
"./vue3": "./lib/vue3.js",
|
|
26
|
-
"./vue3-ts": "./lib/vue3-ts.js",
|
|
27
|
-
"./html": "./lib/html.js",
|
|
28
|
-
"./format-es5": "./lib/format-es5.js",
|
|
29
|
-
"./format-es6": "./lib/format-es6.js",
|
|
30
|
-
"./format-typescript": "./lib/format-typescript.js",
|
|
31
|
-
"./format-import": "./lib/format-import.js",
|
|
32
|
-
"./format-vue2": "./lib/format-vue2.js",
|
|
33
|
-
"./format-vue3": "./lib/format-vue3.js",
|
|
34
|
-
"./format-html": "./lib/format-html.js",
|
|
35
|
-
"./support-es5": "./lib/support/es5-support.js",
|
|
36
|
-
"./support-es6": "./lib/support/es6-support.js",
|
|
37
|
-
"./support-import": "./lib/support/import-support.js",
|
|
38
|
-
"./support-typescript": "./lib/support/typescript-support.js",
|
|
39
|
-
"./support-html": "./lib/support/html-support.js",
|
|
40
|
-
"./support-vue2": "./lib/support/vue2-support.js",
|
|
41
|
-
"./support-vue3": "./lib/support/vue3-support.js",
|
|
42
|
-
"./support-vue3-ts": "./lib/support/vue3-ts-support.js",
|
|
43
|
-
"./utils": "./lib/utils/utils.js"
|
|
20
|
+
".": "./exports.js"
|
|
44
21
|
},
|
|
45
22
|
"repository": {
|
|
46
23
|
"type": "git",
|
|
@@ -51,32 +28,29 @@
|
|
|
51
28
|
},
|
|
52
29
|
"homepage": "https://gitee.com/houheaven/eslint-config-helper",
|
|
53
30
|
"dependencies": {
|
|
54
|
-
"@html-eslint/eslint-plugin": "0.
|
|
55
|
-
"@html-eslint/parser": "0.
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
-
"@typescript-eslint/
|
|
59
|
-
"
|
|
60
|
-
"eslint-import-resolver-alias": "1.1.2",
|
|
61
|
-
"eslint-import-resolver-node": "0.3.6",
|
|
62
|
-
"eslint-import-resolver-webpack": "0.13.2",
|
|
63
|
-
"eslint-plugin-html": "8.1.3",
|
|
31
|
+
"@html-eslint/eslint-plugin": "0.58.1",
|
|
32
|
+
"@html-eslint/parser": "0.58.1",
|
|
33
|
+
"@stylistic/eslint-plugin": "5.10.0",
|
|
34
|
+
"@typescript-eslint/eslint-plugin": "8.57.0",
|
|
35
|
+
"@typescript-eslint/parser": "8.57.0",
|
|
36
|
+
"eslint-plugin-html": "8.1.4",
|
|
64
37
|
"eslint-plugin-import": "2.32.0",
|
|
65
38
|
"eslint-plugin-vue": "9.33.0",
|
|
39
|
+
"globals": "17.4.0",
|
|
40
|
+
"vue-eslint-parser": "^9.4.0",
|
|
66
41
|
"@houheaven/eslint-config-helper-core": "1.0.0"
|
|
67
42
|
},
|
|
68
43
|
"devDependencies": {
|
|
69
|
-
"eslint": "
|
|
44
|
+
"eslint": "9.39.4",
|
|
70
45
|
"typescript": "5.9.3"
|
|
71
46
|
},
|
|
72
47
|
"peerDependencies": {
|
|
73
|
-
"eslint": "
|
|
48
|
+
"eslint": "^9.0.0 || ^10.0.0"
|
|
74
49
|
},
|
|
75
50
|
"bundledDependencies": [
|
|
76
51
|
"@houheaven/eslint-config-helper-core"
|
|
77
52
|
],
|
|
78
53
|
"scripts": {
|
|
79
|
-
"lint": "eslint ."
|
|
80
|
-
"lint-fix": "eslint . --fix"
|
|
54
|
+
"lint": "eslint ."
|
|
81
55
|
}
|
|
82
56
|
}
|
|
@@ -1,478 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// ==========================================================
|
|
3
|
-
// 此文件是 Prettier 与 Eslint 共用时,会产生冲突的规则列表
|
|
4
|
-
// 此处仅仅是做一个记录,目前暂无应用
|
|
5
|
-
// ==========================================================
|
|
6
|
-
|
|
7
|
-
module.exports = {
|
|
8
|
-
env: {
|
|
9
|
-
browser: true,
|
|
10
|
-
commonjs: true,
|
|
11
|
-
node: true,
|
|
12
|
-
es2021: true,
|
|
13
|
-
},
|
|
14
|
-
parserOptions: {
|
|
15
|
-
ecmaVersion: 2021,
|
|
16
|
-
sourceType: "module",
|
|
17
|
-
},
|
|
18
|
-
rules: {
|
|
19
|
-
// 在某些情况下,可以使用以下规则,阅读 README 获取更多信息
|
|
20
|
-
// 它们用“0”而不是“off”标记,以便脚本可以区分它们
|
|
21
|
-
|
|
22
|
-
// 强制所有控制语句使用一致的括号风格
|
|
23
|
-
"curly": 0,
|
|
24
|
-
|
|
25
|
-
// 要求在注释周围有空行
|
|
26
|
-
"lines-around-comment": 0,
|
|
27
|
-
|
|
28
|
-
// 强制一行的最大长度
|
|
29
|
-
"max-len": ["warn", {
|
|
30
|
-
"code": 200,
|
|
31
|
-
"tabWidth": 2,
|
|
32
|
-
"comments": 200,
|
|
33
|
-
"ignoreComments": false,
|
|
34
|
-
"ignoreTrailingComments": true,
|
|
35
|
-
"ignoreUrls": true,
|
|
36
|
-
"ignoreStrings": true,
|
|
37
|
-
"ignoreTemplateLiterals": true,
|
|
38
|
-
"ignoreRegExpLiterals": true,
|
|
39
|
-
}],
|
|
40
|
-
|
|
41
|
-
// 禁止在可能与比较操作符相混淆的地方使用箭头函数
|
|
42
|
-
"no-confusing-arrow": ["error", {
|
|
43
|
-
"allowParens": true,
|
|
44
|
-
}],
|
|
45
|
-
|
|
46
|
-
// 禁止混合使用不同的操作符
|
|
47
|
-
"no-mixed-operators": [
|
|
48
|
-
"off",
|
|
49
|
-
{
|
|
50
|
-
"groups": [
|
|
51
|
-
["+", "-", "*", "/", "%", "**"],
|
|
52
|
-
["&", "|", "^", "~", "<<", ">>", ">>>"],
|
|
53
|
-
["==", "!=", "===", "!==", ">", ">=", "<", "<="],
|
|
54
|
-
["&&", "||"],
|
|
55
|
-
["in", "instanceof"],
|
|
56
|
-
],
|
|
57
|
-
"allowSamePrecedence": true,
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
|
|
61
|
-
// 禁用 tab
|
|
62
|
-
"no-tabs": "warn",
|
|
63
|
-
|
|
64
|
-
// 禁止出现令人困惑的多行表达式
|
|
65
|
-
"no-unexpected-multiline": "error",
|
|
66
|
-
|
|
67
|
-
// 强制使用一致的反勾号、双引号或单引号
|
|
68
|
-
"quotes": ["warn", "double", { "avoidEscape": true }],
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
// 以下的规则在使用Prettier时不需要启用
|
|
72
|
-
|
|
73
|
-
// 在数组开括号后和闭括号前强制换行
|
|
74
|
-
"array-bracket-newline": ["warn", "consistent"],
|
|
75
|
-
|
|
76
|
-
// 强制数组方括号中使用一致的空格
|
|
77
|
-
"array-bracket-spacing": ["error", "never"],
|
|
78
|
-
|
|
79
|
-
// 强制数组元素间出现换行
|
|
80
|
-
"array-element-newline": ["warn", "consistent"],
|
|
81
|
-
|
|
82
|
-
// 要求箭头函数的参数使用圆括号
|
|
83
|
-
"arrow-parens": ["warn", "as-needed"],
|
|
84
|
-
|
|
85
|
-
// 要求箭头函数的箭头之前或之后有空格
|
|
86
|
-
"arrow-spacing": ["warn", {
|
|
87
|
-
"before": true,
|
|
88
|
-
"after": true,
|
|
89
|
-
}],
|
|
90
|
-
|
|
91
|
-
// 禁止或强制在代码块中开括号前和闭括号后有空格
|
|
92
|
-
"block-spacing": ["warn", "always"],
|
|
93
|
-
|
|
94
|
-
// 强制在代码块中使用一致的大括号风格
|
|
95
|
-
"brace-style": ["warn", "stroustrup", { "allowSingleLine": true }],
|
|
96
|
-
|
|
97
|
-
// 要求或禁止使用拖尾逗号(对象、数组、导入、导出、函数参数的最后一项后面是否允许有逗号)
|
|
98
|
-
"comma-dangle": ["warn", {
|
|
99
|
-
arrays: "always-multiline",
|
|
100
|
-
objects: "always-multiline",
|
|
101
|
-
imports: "always-multiline",
|
|
102
|
-
exports: "always-multiline",
|
|
103
|
-
functions: "never",
|
|
104
|
-
}],
|
|
105
|
-
|
|
106
|
-
// 强制在逗号前后使用一致的空格
|
|
107
|
-
"comma-spacing": ["warn", {
|
|
108
|
-
"before": false,
|
|
109
|
-
"after": true,
|
|
110
|
-
}],
|
|
111
|
-
|
|
112
|
-
// 强制使用一致的逗号风格
|
|
113
|
-
"comma-style": ["warn", "last", {
|
|
114
|
-
exceptions: {
|
|
115
|
-
ArrayExpression: false,
|
|
116
|
-
ArrayPattern: false,
|
|
117
|
-
ArrowFunctionExpression: false,
|
|
118
|
-
CallExpression: false,
|
|
119
|
-
FunctionDeclaration: false,
|
|
120
|
-
FunctionExpression: false,
|
|
121
|
-
ImportDeclaration: false,
|
|
122
|
-
ObjectExpression: false,
|
|
123
|
-
ObjectPattern: false,
|
|
124
|
-
VariableDeclaration: false,
|
|
125
|
-
NewExpression: false,
|
|
126
|
-
},
|
|
127
|
-
}],
|
|
128
|
-
|
|
129
|
-
// 强制在计算的属性的方括号中使用一致的空格
|
|
130
|
-
"computed-property-spacing": ["warn", "never"],
|
|
131
|
-
|
|
132
|
-
// 强制在点号之前和之后一致的换行
|
|
133
|
-
"dot-location": ["warn", "property"],
|
|
134
|
-
|
|
135
|
-
// 要求或禁止文件末尾存在空行
|
|
136
|
-
"eol-last": ["warn", "always"],
|
|
137
|
-
|
|
138
|
-
// 要求或禁止在函数标识符和其调用之间有空格
|
|
139
|
-
"func-call-spacing": ["warn", "never"],
|
|
140
|
-
|
|
141
|
-
// 函数调用参数换行符
|
|
142
|
-
"function-call-argument-newline": ["warn", "consistent"],
|
|
143
|
-
|
|
144
|
-
// 强制在函数括号内使用一致的换行
|
|
145
|
-
"function-paren-newline": ["warn", "consistent"],
|
|
146
|
-
|
|
147
|
-
// generator 函数中 * 号
|
|
148
|
-
// "generator-star": "error",
|
|
149
|
-
|
|
150
|
-
// 强制 generator 函数中 * 号周围使用一致的空格
|
|
151
|
-
"generator-star-spacing": ["warn", {
|
|
152
|
-
before: false,
|
|
153
|
-
after: true,
|
|
154
|
-
}],
|
|
155
|
-
|
|
156
|
-
// 强制隐式返回的箭头函数体的位置
|
|
157
|
-
"implicit-arrow-linebreak": ["warn", "beside"],
|
|
158
|
-
|
|
159
|
-
// 强制使用一致的缩进
|
|
160
|
-
"indent": ["error", 2, {
|
|
161
|
-
SwitchCase: 1,
|
|
162
|
-
VariableDeclarator: 1,
|
|
163
|
-
outerIIFEBody: 1,
|
|
164
|
-
// MemberExpression: null,
|
|
165
|
-
FunctionDeclaration: {
|
|
166
|
-
parameters: 1,
|
|
167
|
-
body: 1,
|
|
168
|
-
},
|
|
169
|
-
FunctionExpression: {
|
|
170
|
-
parameters: 1,
|
|
171
|
-
body: 1,
|
|
172
|
-
},
|
|
173
|
-
CallExpression: {
|
|
174
|
-
arguments: 1,
|
|
175
|
-
},
|
|
176
|
-
ArrayExpression: 1,
|
|
177
|
-
ObjectExpression: 1,
|
|
178
|
-
ImportDeclaration: 1,
|
|
179
|
-
flatTernaryExpressions: false,
|
|
180
|
-
// list derived from https://github.com/benjamn/ast-types/blob/HEAD/def/jsx.js
|
|
181
|
-
ignoredNodes: [
|
|
182
|
-
"JSXElement",
|
|
183
|
-
"JSXElement > *",
|
|
184
|
-
"JSXAttribute",
|
|
185
|
-
"JSXIdentifier",
|
|
186
|
-
"JSXNamespacedName",
|
|
187
|
-
"JSXMemberExpression",
|
|
188
|
-
"JSXSpreadAttribute",
|
|
189
|
-
"JSXExpressionContainer",
|
|
190
|
-
"JSXOpeningElement",
|
|
191
|
-
"JSXClosingElement",
|
|
192
|
-
"JSXFragment",
|
|
193
|
-
"JSXOpeningFragment",
|
|
194
|
-
"JSXClosingFragment",
|
|
195
|
-
"JSXText",
|
|
196
|
-
"JSXEmptyExpression",
|
|
197
|
-
"JSXSpreadChild",
|
|
198
|
-
],
|
|
199
|
-
ignoreComments: false,
|
|
200
|
-
}],
|
|
201
|
-
|
|
202
|
-
// 强制在 JSX 属性中一致地使用双引号或单引号
|
|
203
|
-
"jsx-quotes": ["warn", "prefer-double"],
|
|
204
|
-
|
|
205
|
-
// 强制在对象字面量的键和值之间使用一致的空格
|
|
206
|
-
"key-spacing": ["warn", {
|
|
207
|
-
beforeColon: false,
|
|
208
|
-
afterColon: true,
|
|
209
|
-
}],
|
|
210
|
-
|
|
211
|
-
// 强制关键字周围空格的一致性
|
|
212
|
-
"keyword-spacing": ["warn", {
|
|
213
|
-
"before": true,
|
|
214
|
-
"after": true,
|
|
215
|
-
"overrides": {
|
|
216
|
-
"if": { "after": true },
|
|
217
|
-
"for": { "after": false },
|
|
218
|
-
"while": { "after": false },
|
|
219
|
-
"switch": { "after": false },
|
|
220
|
-
"case": { "after": true },
|
|
221
|
-
"catch": { "after": false },
|
|
222
|
-
"return": { "after": true },
|
|
223
|
-
"throw": { "after": true },
|
|
224
|
-
},
|
|
225
|
-
}],
|
|
226
|
-
|
|
227
|
-
// 强制使用一致的换行符风格
|
|
228
|
-
// Windows - "CRLF"
|
|
229
|
-
// Unix、Linux - "LF"
|
|
230
|
-
"linebreak-style": ["warn", "unix"],
|
|
231
|
-
|
|
232
|
-
// 要求或禁止在三元操作数中间换行
|
|
233
|
-
// TODO: enable?
|
|
234
|
-
"multiline-ternary": ["off", "never"],
|
|
235
|
-
|
|
236
|
-
// 要求方法链中每个调用都有一个换行符
|
|
237
|
-
"newline-per-chained-call": ["warn", { ignoreChainWithDepth: 4 }],
|
|
238
|
-
|
|
239
|
-
// 强制或禁止调用无参构造函数时有圆括号
|
|
240
|
-
"new-parens": ["error", "always"],
|
|
241
|
-
|
|
242
|
-
// 禁止冗余的括号
|
|
243
|
-
"no-extra-parens": ["off", "all", {
|
|
244
|
-
"conditionalAssign": true,
|
|
245
|
-
"nestedBinaryExpressions": false,
|
|
246
|
-
"returnAssign": false,
|
|
247
|
-
"ignoreJSX": "all", // delegate to eslint-plugin-react
|
|
248
|
-
"enforceForArrowConditionals": false,
|
|
249
|
-
}],
|
|
250
|
-
|
|
251
|
-
// 禁止不必要的分号
|
|
252
|
-
"no-extra-semi": "warn",
|
|
253
|
-
|
|
254
|
-
// 禁止数字字面量中使用前导和末尾小数点
|
|
255
|
-
"no-floating-decimal": "error",
|
|
256
|
-
|
|
257
|
-
// 禁止空格和 tab 的混合缩进
|
|
258
|
-
"no-mixed-spaces-and-tabs": "warn",
|
|
259
|
-
|
|
260
|
-
// 禁止使用多个空格
|
|
261
|
-
"no-multi-spaces": ["warn", { "ignoreEOLComments": true }],
|
|
262
|
-
|
|
263
|
-
// 禁止出现多行空行
|
|
264
|
-
"no-multiple-empty-lines": ["warn", {
|
|
265
|
-
"max": 2,
|
|
266
|
-
"maxBOF": 1,
|
|
267
|
-
"maxEOF": 1,
|
|
268
|
-
}],
|
|
269
|
-
|
|
270
|
-
// 禁用行尾空格
|
|
271
|
-
"no-trailing-spaces": ["warn", {
|
|
272
|
-
"skipBlankLines": true,
|
|
273
|
-
"ignoreComments": false,
|
|
274
|
-
}],
|
|
275
|
-
|
|
276
|
-
// 禁止属性前有空白
|
|
277
|
-
"no-whitespace-before-property": "error",
|
|
278
|
-
|
|
279
|
-
// 强制单个语句的位置
|
|
280
|
-
"nonblock-statement-body-position": "off",
|
|
281
|
-
|
|
282
|
-
// 强制大括号内换行符的一致性
|
|
283
|
-
"object-curly-newline": ["warn", {
|
|
284
|
-
ObjectExpression: { minProperties: 40, multiline: true, consistent: true },
|
|
285
|
-
ObjectPattern: "never",
|
|
286
|
-
ImportDeclaration: "never",
|
|
287
|
-
ExportDeclaration: "always",
|
|
288
|
-
}],
|
|
289
|
-
|
|
290
|
-
// 强制在花括号中使用一致的空格
|
|
291
|
-
"object-curly-spacing": ["warn", "always", {
|
|
292
|
-
arraysInObjects: true,
|
|
293
|
-
objectsInObjects: true,
|
|
294
|
-
}],
|
|
295
|
-
|
|
296
|
-
// 强制将对象的属性放在不同的行上
|
|
297
|
-
"object-property-newline": ["off", {
|
|
298
|
-
allowAllPropertiesOnSameLine: true,
|
|
299
|
-
}],
|
|
300
|
-
|
|
301
|
-
// 要求或禁止在变量声明周围换行
|
|
302
|
-
"one-var-declaration-per-line": "off",
|
|
303
|
-
|
|
304
|
-
// 强制操作符使用一致的换行符
|
|
305
|
-
"operator-linebreak": ["off", "before", { overrides: { "=": "none" } }],
|
|
306
|
-
|
|
307
|
-
// 要求或禁止块内填充
|
|
308
|
-
"padded-blocks": "off",
|
|
309
|
-
|
|
310
|
-
// 要求对象字面量属性名称用引号括起来
|
|
311
|
-
"quote-props": ["warn", "consistent"],
|
|
312
|
-
|
|
313
|
-
// 强制剩余和扩展运算符及其表达式之间有空格
|
|
314
|
-
"rest-spread-spacing": ["error", "never"],
|
|
315
|
-
|
|
316
|
-
// 要求或禁止使用分号代替 ASI
|
|
317
|
-
"semi": ["error", "always"],
|
|
318
|
-
|
|
319
|
-
// 强制分号之前和之后使用一致的空格
|
|
320
|
-
"semi-spacing": ["error", { before: false, after: true }],
|
|
321
|
-
|
|
322
|
-
// 强制分号的位置
|
|
323
|
-
"semi-style": ["error", "last"],
|
|
324
|
-
|
|
325
|
-
// 要求或禁止语句块之前的空格(代码块大括号前面是否需要空格)
|
|
326
|
-
"space-before-blocks": ["warn", {
|
|
327
|
-
"functions": "always",
|
|
328
|
-
"keywords": "always",
|
|
329
|
-
"classes": "always",
|
|
330
|
-
}],
|
|
331
|
-
|
|
332
|
-
// 强制在 function 的左括号之前使用一致的空格
|
|
333
|
-
"space-before-function-paren": ["warn", {
|
|
334
|
-
"anonymous": "never",
|
|
335
|
-
"named": "never",
|
|
336
|
-
"asyncArrow": "always",
|
|
337
|
-
}],
|
|
338
|
-
|
|
339
|
-
// 强制在圆括号内使用一致的空格
|
|
340
|
-
"space-in-parens": ["warn", "never"],
|
|
341
|
-
|
|
342
|
-
// 要求中缀操作符周围有空格(+-*/?| etc.)
|
|
343
|
-
"space-infix-ops": "warn",
|
|
344
|
-
|
|
345
|
-
// 强制在一元操作符前后使用一致的空格
|
|
346
|
-
"space-unary-ops": ["warn", {
|
|
347
|
-
"words": true,
|
|
348
|
-
"nonwords": false,
|
|
349
|
-
}],
|
|
350
|
-
|
|
351
|
-
// 强制在 switch 的冒号左右有空格
|
|
352
|
-
"switch-colon-spacing": ["error", { after: true, before: false }],
|
|
353
|
-
|
|
354
|
-
// 要求或禁止模板字符串中的嵌入表达式周围空格的使用
|
|
355
|
-
"template-curly-spacing": "warn",
|
|
356
|
-
|
|
357
|
-
// 要求或禁止在模板标记和它们的字面量之间有空格
|
|
358
|
-
"template-tag-spacing": ["error", "never"],
|
|
359
|
-
|
|
360
|
-
// 要求或禁止 Unicode 字节顺序标记 (BOM)
|
|
361
|
-
"unicode-bom": ["off", "never"],
|
|
362
|
-
|
|
363
|
-
// 要求 IIFE 使用括号括起来
|
|
364
|
-
"wrap-iife": ["error", "outside", { functionPrototypeMethods: true }],
|
|
365
|
-
|
|
366
|
-
// 要求正则表达式被括号括起来
|
|
367
|
-
"wrap-regex": "off",
|
|
368
|
-
|
|
369
|
-
// 强制在 yield* 表达式中 * 周围使用空格
|
|
370
|
-
"yield-star-spacing": ["error", "both"],
|
|
371
|
-
|
|
372
|
-
// 已废弃
|
|
373
|
-
"no-arrow-condition": "off",
|
|
374
|
-
"no-comma-dangle": "off",
|
|
375
|
-
"no-reserved-keys": "off",
|
|
376
|
-
"no-space-before-semi": "off",
|
|
377
|
-
"no-wrap-func": "off",
|
|
378
|
-
"space-after-function-name": "off",
|
|
379
|
-
"space-after-keywords": "off",
|
|
380
|
-
"space-before-function-parentheses": "off",
|
|
381
|
-
"space-before-keywords": "off",
|
|
382
|
-
"space-in-brackets": "off",
|
|
383
|
-
"space-return-throw-case": "off",
|
|
384
|
-
"space-unary-word-ops": "off",
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
"@typescript-eslint/quotes": 0,
|
|
388
|
-
"babel/quotes": 0,
|
|
389
|
-
"@babel/object-curly-spacing": "off",
|
|
390
|
-
"@babel/semi": "off",
|
|
391
|
-
"@typescript-eslint/brace-style": "off",
|
|
392
|
-
"@typescript-eslint/comma-dangle": "off",
|
|
393
|
-
"@typescript-eslint/comma-spacing": "off",
|
|
394
|
-
"@typescript-eslint/func-call-spacing": "off",
|
|
395
|
-
"@typescript-eslint/indent": "off",
|
|
396
|
-
"@typescript-eslint/keyword-spacing": "off",
|
|
397
|
-
"@typescript-eslint/member-delimiter-style": "off",
|
|
398
|
-
"@typescript-eslint/no-extra-parens": "off",
|
|
399
|
-
"@typescript-eslint/no-extra-semi": "off",
|
|
400
|
-
"@typescript-eslint/object-curly-spacing": "off",
|
|
401
|
-
"@typescript-eslint/semi": "off",
|
|
402
|
-
"@typescript-eslint/space-before-blocks": "off",
|
|
403
|
-
"@typescript-eslint/space-before-function-paren": "off",
|
|
404
|
-
"@typescript-eslint/space-infix-ops": "off",
|
|
405
|
-
"@typescript-eslint/type-annotation-spacing": "off",
|
|
406
|
-
"babel/object-curly-spacing": "off",
|
|
407
|
-
"babel/semi": "off",
|
|
408
|
-
"flowtype/boolean-style": "off",
|
|
409
|
-
"flowtype/delimiter-dangle": "off",
|
|
410
|
-
"flowtype/generic-spacing": "off",
|
|
411
|
-
"flowtype/object-type-curly-spacing": "off",
|
|
412
|
-
"flowtype/object-type-delimiter": "off",
|
|
413
|
-
"flowtype/quotes": "off",
|
|
414
|
-
"flowtype/semi": "off",
|
|
415
|
-
"flowtype/space-after-type-colon": "off",
|
|
416
|
-
"flowtype/space-before-generic-bracket": "off",
|
|
417
|
-
"flowtype/space-before-type-colon": "off",
|
|
418
|
-
"flowtype/union-intersection-spacing": "off",
|
|
419
|
-
"react/jsx-child-element-spacing": "off",
|
|
420
|
-
"react/jsx-closing-bracket-location": "off",
|
|
421
|
-
"react/jsx-closing-tag-location": "off",
|
|
422
|
-
"react/jsx-curly-newline": "off",
|
|
423
|
-
"react/jsx-curly-spacing": "off",
|
|
424
|
-
"react/jsx-equals-spacing": "off",
|
|
425
|
-
"react/jsx-first-prop-new-line": "off",
|
|
426
|
-
"react/jsx-indent": "off",
|
|
427
|
-
"react/jsx-indent-props": "off",
|
|
428
|
-
"react/jsx-max-props-per-line": "off",
|
|
429
|
-
"react/jsx-newline": "off",
|
|
430
|
-
"react/jsx-one-expression-per-line": "off",
|
|
431
|
-
"react/jsx-props-no-multi-spaces": "off",
|
|
432
|
-
"react/jsx-tag-spacing": "off",
|
|
433
|
-
"react/jsx-wrap-multilines": "off",
|
|
434
|
-
"standard/array-bracket-even-spacing": "off",
|
|
435
|
-
"standard/computed-property-even-spacing": "off",
|
|
436
|
-
"standard/object-curly-even-spacing": "off",
|
|
437
|
-
"unicorn/empty-brace-spaces": "off",
|
|
438
|
-
"unicorn/no-nested-ternary": "off",
|
|
439
|
-
"unicorn/number-literal-case": "off",
|
|
440
|
-
"vue/array-bracket-newline": "off",
|
|
441
|
-
"vue/array-bracket-spacing": "off",
|
|
442
|
-
"vue/arrow-spacing": "off",
|
|
443
|
-
"vue/block-spacing": "off",
|
|
444
|
-
"vue/block-tag-newline": "off",
|
|
445
|
-
"vue/brace-style": "off",
|
|
446
|
-
"vue/comma-dangle": "off",
|
|
447
|
-
"vue/comma-spacing": "off",
|
|
448
|
-
"vue/comma-style": "off",
|
|
449
|
-
"vue/dot-location": "off",
|
|
450
|
-
"vue/func-call-spacing": "off",
|
|
451
|
-
"vue/html-closing-bracket-newline": "off",
|
|
452
|
-
"vue/html-closing-bracket-spacing": "off",
|
|
453
|
-
"vue/html-end-tags": "off",
|
|
454
|
-
"vue/html-indent": "off",
|
|
455
|
-
"vue/html-quotes": "off",
|
|
456
|
-
"vue/key-spacing": "off",
|
|
457
|
-
"vue/keyword-spacing": "off",
|
|
458
|
-
"vue/max-attributes-per-line": "off",
|
|
459
|
-
"vue/multiline-html-element-content-newline": "off",
|
|
460
|
-
"vue/mustache-interpolation-spacing": "off",
|
|
461
|
-
"vue/no-extra-parens": "off",
|
|
462
|
-
"vue/no-multi-spaces": "off",
|
|
463
|
-
"vue/no-spaces-around-equal-signs-in-attribute": "off",
|
|
464
|
-
"vue/object-curly-newline": "off",
|
|
465
|
-
"vue/object-curly-spacing": "off",
|
|
466
|
-
"vue/object-property-newline": "off",
|
|
467
|
-
"vue/operator-linebreak": "off",
|
|
468
|
-
"vue/quote-props": "off",
|
|
469
|
-
"vue/script-indent": "off",
|
|
470
|
-
"vue/singleline-html-element-content-newline": "off",
|
|
471
|
-
"vue/space-in-parens": "off",
|
|
472
|
-
"vue/space-infix-ops": "off",
|
|
473
|
-
"vue/space-unary-ops": "off",
|
|
474
|
-
"vue/template-curly-spacing": "off",
|
|
475
|
-
"vue/html-self-closing": 0,
|
|
476
|
-
"vue/max-len": 0,
|
|
477
|
-
},
|
|
478
|
-
};
|
package/lib/format-es5.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// ==========================================================
|
|
3
|
-
// @houheaven/eslint-config-helper/format-es5
|
|
4
|
-
// ----------------------------------------------------------
|
|
5
|
-
// - Eslint ES5 格式化规则(warn)
|
|
6
|
-
// ==========================================================
|
|
7
|
-
|
|
8
|
-
const utils = require("@houheaven/eslint-config-helper-core");
|
|
9
|
-
|
|
10
|
-
module.exports = {
|
|
11
|
-
// 当 eslint-disable 注释配置未使用时,是否报错
|
|
12
|
-
reportUnusedDisableDirectives: false,
|
|
13
|
-
// 继承配置文件
|
|
14
|
-
extends: [
|
|
15
|
-
// Eslint ES5 支持
|
|
16
|
-
"./support/es5-support.js",
|
|
17
|
-
],
|
|
18
|
-
// 规则
|
|
19
|
-
rules: {
|
|
20
|
-
// Eslint ES5 规则(warn)
|
|
21
|
-
...utils.getWarnRules("es5"),
|
|
22
|
-
},
|
|
23
|
-
};
|
package/lib/format-es6.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// ==========================================================
|
|
3
|
-
// @houheaven/eslint-config-helper/format
|
|
4
|
-
// ----------------------------------------------------------
|
|
5
|
-
// - Eslint ES5 格式化规则(warn)
|
|
6
|
-
// - Eslint ES6+ 格式化规则(warn)
|
|
7
|
-
// ==========================================================
|
|
8
|
-
|
|
9
|
-
const utils = require("@houheaven/eslint-config-helper-core");
|
|
10
|
-
|
|
11
|
-
module.exports = {
|
|
12
|
-
// 当 eslint-disable 注释配置未使用时,是否报错
|
|
13
|
-
reportUnusedDisableDirectives: false,
|
|
14
|
-
// 继承配置文件
|
|
15
|
-
extends: [
|
|
16
|
-
// Eslint ES6 支持
|
|
17
|
-
"./support/es6-support.js",
|
|
18
|
-
],
|
|
19
|
-
// 规则
|
|
20
|
-
rules: {
|
|
21
|
-
// Eslint ES6 规则(warn)
|
|
22
|
-
...utils.getWarnRules("es5"),
|
|
23
|
-
...utils.getWarnRules("es6"),
|
|
24
|
-
},
|
|
25
|
-
};
|
package/lib/format-html.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// ==========================================================
|
|
3
|
-
// @houheaven/eslint-config-helper/format-html
|
|
4
|
-
// ----------------------------------------------------------
|
|
5
|
-
// - @html-eslint/eslint-plugin 定制规则(warn)
|
|
6
|
-
// ==========================================================
|
|
7
|
-
|
|
8
|
-
const utils = require("@houheaven/eslint-config-helper-core");
|
|
9
|
-
|
|
10
|
-
module.exports = {
|
|
11
|
-
// 当 eslint-disable 注释配置未使用时,是否报错
|
|
12
|
-
reportUnusedDisableDirectives: false,
|
|
13
|
-
// 继承配置文件
|
|
14
|
-
extends: [
|
|
15
|
-
// html 支持
|
|
16
|
-
"./support/html-support.js",
|
|
17
|
-
],
|
|
18
|
-
// 规则
|
|
19
|
-
rules: {
|
|
20
|
-
// html 规则(warn)
|
|
21
|
-
...utils.getWarnRules("html"),
|
|
22
|
-
},
|
|
23
|
-
};
|
package/lib/format-import.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// ==========================================================
|
|
3
|
-
// @houheaven/eslint-config-helper/format-import
|
|
4
|
-
// ----------------------------------------------------------
|
|
5
|
-
// - eslint-plugin-import 格式化规则(warn)
|
|
6
|
-
// ==========================================================
|
|
7
|
-
|
|
8
|
-
const utils = require("@houheaven/eslint-config-helper-core");
|
|
9
|
-
|
|
10
|
-
module.exports = {
|
|
11
|
-
// 当 eslint-disable 注释配置未使用时,是否报错
|
|
12
|
-
reportUnusedDisableDirectives: false,
|
|
13
|
-
// 继承配置文件
|
|
14
|
-
extends: [
|
|
15
|
-
// eslint-plugin-import 支持
|
|
16
|
-
"./support/import-support.js",
|
|
17
|
-
],
|
|
18
|
-
// 规则
|
|
19
|
-
rules: {
|
|
20
|
-
// eslint-plugin-import 规则(warn)
|
|
21
|
-
...utils.getWarnRules("import"),
|
|
22
|
-
},
|
|
23
|
-
};
|