eslint-config-seekingalpha-base 6.26.0 → 7.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/CHANGELOG.md +9 -0
- package/README.md +1 -1
- package/index.js +3 -0
- package/package.json +7 -5
- package/prettier.js +59 -59
- package/rules/eslint/layout-and-formatting.js +0 -482
- package/rules/eslint/suggestions.js +0 -47
- package/rules/eslint-plugin-stylistic-js/index.js +530 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 7.0.0 - 2023-11-05
|
|
4
|
+
|
|
5
|
+
- [deps] update `eslint` to version `8.53.0`
|
|
6
|
+
- [breaking] migrate to `@stylistic/eslint-plugin-js`
|
|
7
|
+
|
|
8
|
+
## 6.28.0 - 2023-11-01
|
|
9
|
+
|
|
10
|
+
- [deps] update `eslint-plugin-unicorn` to version `49.0.0`
|
|
11
|
+
|
|
3
12
|
## 6.26.0 - 2023-10-23
|
|
4
13
|
|
|
5
14
|
- [deps] update `eslint-plugin-import` to version `2.29.0`
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ This package includes the shareable ESLint config used by [SeekingAlpha](https:/
|
|
|
6
6
|
|
|
7
7
|
Install ESLint and all [Peer Dependencies](https://nodejs.org/en/blog/npm/peer-dependencies/):
|
|
8
8
|
|
|
9
|
-
npm install eslint@8.
|
|
9
|
+
npm install eslint@8.53.0 @stylistic/eslint-plugin-js@1.0.0 eslint-plugin-array-func@4.0.0 eslint-plugin-import@2.29.0 eslint-plugin-no-use-extend-native@0.5.0 eslint-plugin-promise@6.1.1 eslint-plugin-unicorn@49.0.0 --save-dev
|
|
10
10
|
|
|
11
11
|
Install SeekingAlpha shareable ESLint:
|
|
12
12
|
|
package/index.js
CHANGED
|
@@ -3,6 +3,9 @@ module.exports = {
|
|
|
3
3
|
// ESLint rules (https://eslint.org/docs/rules/)
|
|
4
4
|
'./rules/eslint/index.js',
|
|
5
5
|
|
|
6
|
+
// ESLint Stylistic Stylistic Formatting https://eslint.style/packages/js
|
|
7
|
+
'./rules/eslint-plugin-stylistic-js/index.js',
|
|
8
|
+
|
|
6
9
|
// eslint-plugin-import rules (https://github.com/benmosher/eslint-plugin-import)
|
|
7
10
|
'./rules/eslint-plugin-import/index.js',
|
|
8
11
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-seekingalpha-base",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "SeekingAlpha's sharable base ESLint config",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -48,20 +48,22 @@
|
|
|
48
48
|
"node": ">= 18"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"eslint": "
|
|
51
|
+
"@stylistic/eslint-plugin-js": "1.0.0",
|
|
52
|
+
"eslint": "8.53.0",
|
|
52
53
|
"eslint-plugin-array-func": "4.0.0",
|
|
53
54
|
"eslint-plugin-import": "2.29.0",
|
|
54
55
|
"eslint-plugin-no-use-extend-native": "0.5.0",
|
|
55
56
|
"eslint-plugin-promise": "6.1.1",
|
|
56
|
-
"eslint-plugin-unicorn": "
|
|
57
|
+
"eslint-plugin-unicorn": "49.0.0"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
59
|
-
"eslint": "
|
|
60
|
+
"@stylistic/eslint-plugin-js": "1.0.0",
|
|
61
|
+
"eslint": "8.53.0",
|
|
60
62
|
"eslint-find-rules": "4.1.0",
|
|
61
63
|
"eslint-plugin-array-func": "4.0.0",
|
|
62
64
|
"eslint-plugin-import": "2.29.0",
|
|
63
65
|
"eslint-plugin-no-use-extend-native": "0.5.0",
|
|
64
66
|
"eslint-plugin-promise": "6.1.1",
|
|
65
|
-
"eslint-plugin-unicorn": "
|
|
67
|
+
"eslint-plugin-unicorn": "49.0.0"
|
|
66
68
|
}
|
|
67
69
|
}
|
package/prettier.js
CHANGED
|
@@ -2,68 +2,68 @@ module.exports = {
|
|
|
2
2
|
extends: ['./index.js'],
|
|
3
3
|
|
|
4
4
|
rules: {
|
|
5
|
-
'array-bracket-newline': 'off',
|
|
6
|
-
'array-bracket-spacing': 'off',
|
|
7
|
-
'array-element-newline': 'off',
|
|
8
|
-
'arrow-parens': 'off',
|
|
9
|
-
'arrow-spacing': 'off',
|
|
10
|
-
'block-spacing': 'off',
|
|
11
|
-
'brace-style': 'off',
|
|
12
|
-
'comma-dangle': 'off',
|
|
13
|
-
'comma-spacing': 'off',
|
|
14
|
-
'comma-style': 'off',
|
|
15
|
-
'computed-property-spacing': 'off',
|
|
16
|
-
'dot-location': 'off',
|
|
17
|
-
'eol-last': 'off',
|
|
18
|
-
'func-call-spacing': 'off',
|
|
19
|
-
'function-call-argument-newline': 'off',
|
|
20
|
-
'function-paren-newline': 'off',
|
|
21
|
-
'generator-star-spacing': 'off',
|
|
22
|
-
'implicit-arrow-linebreak': 'off',
|
|
23
|
-
indent: 'off',
|
|
24
|
-
'jsx-quotes': 'off',
|
|
25
|
-
'key-spacing': 'off',
|
|
26
|
-
'keyword-spacing': 'off',
|
|
27
|
-
'linebreak-style': 'off',
|
|
28
|
-
'multiline-ternary': 'off',
|
|
29
|
-
'newline-per-chained-call': 'off',
|
|
30
|
-
'new-parens': 'off',
|
|
31
|
-
'no-extra-parens': 'off',
|
|
32
|
-
'no-extra-semi': 'off',
|
|
33
|
-
'no-floating-decimal': 'off',
|
|
34
|
-
'no-mixed-spaces-and-tabs': 'off',
|
|
35
|
-
'no-multi-spaces': 'off',
|
|
36
|
-
'no-multiple-empty-lines': 'off',
|
|
37
|
-
'no-trailing-spaces': 'off',
|
|
38
|
-
'no-whitespace-before-property': 'off',
|
|
39
|
-
'nonblock-statement-body-position': 'off',
|
|
40
|
-
'object-curly-newline': 'off',
|
|
41
|
-
'object-curly-spacing': 'off',
|
|
42
|
-
'object-property-newline': 'off',
|
|
43
|
-
'one-var-declaration-per-line': 'off',
|
|
44
|
-
'operator-linebreak': 'off',
|
|
45
|
-
'padded-blocks': 'off',
|
|
46
|
-
'quote-props': 'off',
|
|
47
|
-
'rest-spread-spacing': 'off',
|
|
48
|
-
semi: 'off',
|
|
49
|
-
'semi-spacing': 'off',
|
|
50
|
-
'semi-style': 'off',
|
|
51
|
-
'space-before-blocks': 'off',
|
|
52
|
-
'space-before-function-paren': 'off',
|
|
53
|
-
'space-in-parens': 'off',
|
|
54
|
-
'space-infix-ops': 'off',
|
|
55
|
-
'space-unary-ops': 'off',
|
|
56
|
-
'switch-colon-spacing': 'off',
|
|
57
|
-
'template-curly-spacing': 'off',
|
|
58
|
-
'template-tag-spacing': 'off',
|
|
5
|
+
'@stylistic/js/array-bracket-newline': 'off',
|
|
6
|
+
'@stylistic/js/array-bracket-spacing': 'off',
|
|
7
|
+
'@stylistic/js/array-element-newline': 'off',
|
|
8
|
+
'@stylistic/js/arrow-parens': 'off',
|
|
9
|
+
'@stylistic/js/arrow-spacing': 'off',
|
|
10
|
+
'@stylistic/js/block-spacing': 'off',
|
|
11
|
+
'@stylistic/js/brace-style': 'off',
|
|
12
|
+
'@stylistic/js/comma-dangle': 'off',
|
|
13
|
+
'@stylistic/js/comma-spacing': 'off',
|
|
14
|
+
'@stylistic/js/comma-style': 'off',
|
|
15
|
+
'@stylistic/js/computed-property-spacing': 'off',
|
|
16
|
+
'@stylistic/js/dot-location': 'off',
|
|
17
|
+
'@stylistic/js/eol-last': 'off',
|
|
18
|
+
'@stylistic/js/func-call-spacing': 'off',
|
|
19
|
+
'@stylistic/js/function-call-argument-newline': 'off',
|
|
20
|
+
'@stylistic/js/function-paren-newline': 'off',
|
|
21
|
+
'@stylistic/js/generator-star-spacing': 'off',
|
|
22
|
+
'@stylistic/js/implicit-arrow-linebreak': 'off',
|
|
23
|
+
'@stylistic/js/indent': 'off',
|
|
24
|
+
'@stylistic/js/jsx-quotes': 'off',
|
|
25
|
+
'@stylistic/js/key-spacing': 'off',
|
|
26
|
+
'@stylistic/js/keyword-spacing': 'off',
|
|
27
|
+
'@stylistic/js/linebreak-style': 'off',
|
|
28
|
+
'@stylistic/js/multiline-ternary': 'off',
|
|
29
|
+
'@stylistic/js/newline-per-chained-call': 'off',
|
|
30
|
+
'@stylistic/js/new-parens': 'off',
|
|
31
|
+
'@stylistic/js/no-extra-parens': 'off',
|
|
32
|
+
'@stylistic/js/no-extra-semi': 'off',
|
|
33
|
+
'@stylistic/js/no-floating-decimal': 'off',
|
|
34
|
+
'@stylistic/js/no-mixed-spaces-and-tabs': 'off',
|
|
35
|
+
'@stylistic/js/no-multi-spaces': 'off',
|
|
36
|
+
'@stylistic/js/no-multiple-empty-lines': 'off',
|
|
37
|
+
'@stylistic/js/no-trailing-spaces': 'off',
|
|
38
|
+
'@stylistic/js/no-whitespace-before-property': 'off',
|
|
39
|
+
'@stylistic/js/nonblock-statement-body-position': 'off',
|
|
40
|
+
'@stylistic/js/object-curly-newline': 'off',
|
|
41
|
+
'@stylistic/js/object-curly-spacing': 'off',
|
|
42
|
+
'@stylistic/js/object-property-newline': 'off',
|
|
43
|
+
'@stylistic/js/one-var-declaration-per-line': 'off',
|
|
44
|
+
'@stylistic/js/operator-linebreak': 'off',
|
|
45
|
+
'@stylistic/js/padded-blocks': 'off',
|
|
46
|
+
'@stylistic/js/quote-props': 'off',
|
|
47
|
+
'@stylistic/js/rest-spread-spacing': 'off',
|
|
48
|
+
'@stylistic/js/semi': 'off',
|
|
49
|
+
'@stylistic/js/semi-spacing': 'off',
|
|
50
|
+
'@stylistic/js/semi-style': 'off',
|
|
51
|
+
'@stylistic/js/space-before-blocks': 'off',
|
|
52
|
+
'@stylistic/js/space-before-function-paren': 'off',
|
|
53
|
+
'@stylistic/js/space-in-parens': 'off',
|
|
54
|
+
'@stylistic/js/space-infix-ops': 'off',
|
|
55
|
+
'@stylistic/js/space-unary-ops': 'off',
|
|
56
|
+
'@stylistic/js/switch-colon-spacing': 'off',
|
|
57
|
+
'@stylistic/js/template-curly-spacing': 'off',
|
|
58
|
+
'@stylistic/js/template-tag-spacing': 'off',
|
|
59
|
+
'@stylistic/js/wrap-iife': 'off',
|
|
60
|
+
'@stylistic/js/wrap-regex': 'off',
|
|
61
|
+
'@stylistic/js/yield-star-spacing': 'off',
|
|
59
62
|
'unicode-bom': 'off',
|
|
60
|
-
'wrap-iife': 'off',
|
|
61
|
-
'wrap-regex': 'off',
|
|
62
|
-
'yield-star-spacing': 'off',
|
|
63
63
|
|
|
64
64
|
// Might be enabled
|
|
65
|
-
'lines-around-comment': 'off',
|
|
66
|
-
'no-mixed-operators': 'off',
|
|
65
|
+
'@stylistic/js/lines-around-comment': 'off',
|
|
66
|
+
'@stylistic/js/no-mixed-operators': 'off',
|
|
67
67
|
|
|
68
68
|
// Unicorn
|
|
69
69
|
'unicorn/empty-brace-spaces': 'off',
|
|
@@ -1,180 +1,7 @@
|
|
|
1
|
-
const config = require('../config');
|
|
2
|
-
|
|
3
1
|
module.exports = {
|
|
4
2
|
// https://eslint.org/docs/rules/#layout-formatting
|
|
5
3
|
|
|
6
4
|
rules: {
|
|
7
|
-
// https://eslint.org/docs/rules/array-bracket-newline
|
|
8
|
-
'array-bracket-newline': ['error', 'consistent'],
|
|
9
|
-
|
|
10
|
-
// https://eslint.org/docs/rules/array-bracket-spacing
|
|
11
|
-
'array-bracket-spacing': ['error', 'never'],
|
|
12
|
-
|
|
13
|
-
// https://eslint.org/docs/rules/array-element-newline
|
|
14
|
-
'array-element-newline': 'off',
|
|
15
|
-
|
|
16
|
-
// https://eslint.org/docs/rules/arrow-parens
|
|
17
|
-
'arrow-parens': ['error', 'always'],
|
|
18
|
-
|
|
19
|
-
// https://eslint.org/docs/rules/arrow-spacing
|
|
20
|
-
'arrow-spacing': [
|
|
21
|
-
'error',
|
|
22
|
-
{
|
|
23
|
-
before: true,
|
|
24
|
-
after: true,
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
|
|
28
|
-
// https://eslint.org/docs/rules/block-spacing
|
|
29
|
-
'block-spacing': ['error', 'always'],
|
|
30
|
-
|
|
31
|
-
// https://eslint.org/docs/rules/brace-style
|
|
32
|
-
'brace-style': [
|
|
33
|
-
'error',
|
|
34
|
-
'1tbs',
|
|
35
|
-
{
|
|
36
|
-
allowSingleLine: false,
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
|
|
40
|
-
// https://eslint.org/docs/rules/comma-dangle
|
|
41
|
-
'comma-dangle': [
|
|
42
|
-
'error',
|
|
43
|
-
{
|
|
44
|
-
arrays: 'always-multiline',
|
|
45
|
-
objects: 'always-multiline',
|
|
46
|
-
imports: 'always-multiline',
|
|
47
|
-
exports: 'always-multiline',
|
|
48
|
-
functions: 'never',
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
|
|
52
|
-
// https://eslint.org/docs/rules/comma-spacing
|
|
53
|
-
'comma-spacing': [
|
|
54
|
-
'error',
|
|
55
|
-
{
|
|
56
|
-
before: false,
|
|
57
|
-
after: true,
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
|
|
61
|
-
// https://eslint.org/docs/rules/comma-style
|
|
62
|
-
'comma-style': [
|
|
63
|
-
'error',
|
|
64
|
-
'last',
|
|
65
|
-
{
|
|
66
|
-
exceptions: {
|
|
67
|
-
ArrayExpression: false,
|
|
68
|
-
ArrayPattern: false,
|
|
69
|
-
ArrowFunctionExpression: false,
|
|
70
|
-
CallExpression: false,
|
|
71
|
-
FunctionDeclaration: false,
|
|
72
|
-
FunctionExpression: false,
|
|
73
|
-
ImportDeclaration: false,
|
|
74
|
-
ObjectExpression: false,
|
|
75
|
-
ObjectPattern: false,
|
|
76
|
-
VariableDeclaration: false,
|
|
77
|
-
NewExpression: false,
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
],
|
|
81
|
-
|
|
82
|
-
// https://eslint.org/docs/rules/computed-property-spacing
|
|
83
|
-
'computed-property-spacing': ['error', 'never'],
|
|
84
|
-
|
|
85
|
-
// https://eslint.org/docs/rules/dot-location
|
|
86
|
-
'dot-location': ['error', 'property'],
|
|
87
|
-
|
|
88
|
-
// https://eslint.org/docs/rules/eol-last
|
|
89
|
-
'eol-last': ['error', 'always'],
|
|
90
|
-
|
|
91
|
-
// https://eslint.org/docs/rules/func-call-spacing
|
|
92
|
-
'func-call-spacing': ['error', 'never'],
|
|
93
|
-
|
|
94
|
-
/*
|
|
95
|
-
* TODO Enable when fixed for arrow functions
|
|
96
|
-
* https://eslint.org/docs/rules/function-call-argument-newline
|
|
97
|
-
*/
|
|
98
|
-
'function-call-argument-newline': 'off',
|
|
99
|
-
|
|
100
|
-
// https://eslint.org/docs/rules/function-paren-newline
|
|
101
|
-
'function-paren-newline': ['error', 'consistent'],
|
|
102
|
-
|
|
103
|
-
// https://eslint.org/docs/rules/generator-star-spacing
|
|
104
|
-
'generator-star-spacing': [
|
|
105
|
-
'error',
|
|
106
|
-
{
|
|
107
|
-
before: false,
|
|
108
|
-
after: true,
|
|
109
|
-
},
|
|
110
|
-
],
|
|
111
|
-
|
|
112
|
-
// https://eslint.org/docs/rules/implicit-arrow-linebreak
|
|
113
|
-
'implicit-arrow-linebreak': ['error', 'beside'],
|
|
114
|
-
|
|
115
|
-
// https://eslint.org/docs/rules/indent
|
|
116
|
-
indent: [
|
|
117
|
-
'error',
|
|
118
|
-
config.indent,
|
|
119
|
-
{
|
|
120
|
-
SwitchCase: 1,
|
|
121
|
-
VariableDeclarator: 1,
|
|
122
|
-
outerIIFEBody: 1,
|
|
123
|
-
MemberExpression: 0,
|
|
124
|
-
FunctionDeclaration: {
|
|
125
|
-
parameters: 1,
|
|
126
|
-
body: 1,
|
|
127
|
-
},
|
|
128
|
-
FunctionExpression: {
|
|
129
|
-
parameters: 1,
|
|
130
|
-
body: 1,
|
|
131
|
-
},
|
|
132
|
-
CallExpression: {
|
|
133
|
-
arguments: 1,
|
|
134
|
-
},
|
|
135
|
-
ArrayExpression: 1,
|
|
136
|
-
ObjectExpression: 1,
|
|
137
|
-
ImportDeclaration: 1,
|
|
138
|
-
flatTernaryExpressions: false,
|
|
139
|
-
offsetTernaryExpressions: false,
|
|
140
|
-
ignoredNodes: [],
|
|
141
|
-
ignoreComments: false,
|
|
142
|
-
},
|
|
143
|
-
],
|
|
144
|
-
|
|
145
|
-
// https://eslint.org/docs/rules/jsx-quotes
|
|
146
|
-
'jsx-quotes': ['error', 'prefer-double'],
|
|
147
|
-
|
|
148
|
-
// https://eslint.org/docs/rules/key-spacing
|
|
149
|
-
'key-spacing': [
|
|
150
|
-
'error',
|
|
151
|
-
{
|
|
152
|
-
beforeColon: false,
|
|
153
|
-
afterColon: true,
|
|
154
|
-
mode: 'strict',
|
|
155
|
-
},
|
|
156
|
-
],
|
|
157
|
-
|
|
158
|
-
// https://eslint.org/docs/rules/keyword-spacing
|
|
159
|
-
'keyword-spacing': [
|
|
160
|
-
'error',
|
|
161
|
-
{
|
|
162
|
-
before: true,
|
|
163
|
-
after: true,
|
|
164
|
-
overrides: {
|
|
165
|
-
return: {
|
|
166
|
-
after: true,
|
|
167
|
-
},
|
|
168
|
-
throw: {
|
|
169
|
-
after: true,
|
|
170
|
-
},
|
|
171
|
-
case: {
|
|
172
|
-
after: true,
|
|
173
|
-
},
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
],
|
|
177
|
-
|
|
178
5
|
// https://eslint.org/docs/rules/line-comment-position
|
|
179
6
|
'line-comment-position': [
|
|
180
7
|
'error',
|
|
@@ -185,316 +12,7 @@ module.exports = {
|
|
|
185
12
|
},
|
|
186
13
|
],
|
|
187
14
|
|
|
188
|
-
// https://eslint.org/docs/rules/linebreak-style
|
|
189
|
-
'linebreak-style': ['error', 'unix'],
|
|
190
|
-
|
|
191
|
-
// https://eslint.org/docs/rules/lines-around-comment
|
|
192
|
-
'lines-around-comment': [
|
|
193
|
-
'error',
|
|
194
|
-
{
|
|
195
|
-
beforeBlockComment: true,
|
|
196
|
-
afterBlockComment: false,
|
|
197
|
-
beforeLineComment: true,
|
|
198
|
-
afterLineComment: false,
|
|
199
|
-
allowBlockStart: true,
|
|
200
|
-
allowBlockEnd: false,
|
|
201
|
-
allowObjectStart: true,
|
|
202
|
-
allowObjectEnd: false,
|
|
203
|
-
allowArrayStart: false,
|
|
204
|
-
allowArrayEnd: false,
|
|
205
|
-
allowClassStart: true,
|
|
206
|
-
allowClassEnd: false,
|
|
207
|
-
applyDefaultIgnorePatterns: true,
|
|
208
|
-
ignorePattern: '@ts-expect-error',
|
|
209
|
-
},
|
|
210
|
-
],
|
|
211
|
-
|
|
212
|
-
// https://eslint.org/docs/rules/lines-between-class-members
|
|
213
|
-
'lines-between-class-members': [
|
|
214
|
-
'error',
|
|
215
|
-
'always',
|
|
216
|
-
{
|
|
217
|
-
exceptAfterSingleLine: false,
|
|
218
|
-
},
|
|
219
|
-
],
|
|
220
|
-
|
|
221
|
-
// https://eslint.org/docs/rules/max-len
|
|
222
|
-
'max-len': [
|
|
223
|
-
'error',
|
|
224
|
-
{
|
|
225
|
-
code: config.maxLen,
|
|
226
|
-
tabWidth: config.indent,
|
|
227
|
-
comments: config.maxLen,
|
|
228
|
-
ignorePattern: 'ignore-long-line',
|
|
229
|
-
ignoreComments: false,
|
|
230
|
-
ignoreTrailingComments: false,
|
|
231
|
-
ignoreRegExpLiterals: false,
|
|
232
|
-
ignoreStrings: false,
|
|
233
|
-
ignoreTemplateLiterals: false,
|
|
234
|
-
ignoreUrls: true,
|
|
235
|
-
},
|
|
236
|
-
],
|
|
237
|
-
|
|
238
|
-
// https://eslint.org/docs/rules/max-statements-per-line
|
|
239
|
-
'max-statements-per-line': [
|
|
240
|
-
'error',
|
|
241
|
-
{
|
|
242
|
-
max: config.maxStatementsPerLine,
|
|
243
|
-
},
|
|
244
|
-
],
|
|
245
|
-
|
|
246
|
-
// https://eslint.org/docs/rules/multiline-ternary
|
|
247
|
-
'multiline-ternary': 'off',
|
|
248
|
-
|
|
249
|
-
// https://eslint.org/docs/rules/new-parens
|
|
250
|
-
'new-parens': 'error',
|
|
251
|
-
|
|
252
|
-
// https://eslint.org/docs/rules/newline-per-chained-call
|
|
253
|
-
'newline-per-chained-call': [
|
|
254
|
-
'error',
|
|
255
|
-
{
|
|
256
|
-
ignoreChainWithDepth: 2,
|
|
257
|
-
},
|
|
258
|
-
],
|
|
259
|
-
|
|
260
|
-
// https://eslint.org/docs/rules/no-extra-parens
|
|
261
|
-
'no-extra-parens': [
|
|
262
|
-
'error',
|
|
263
|
-
'all',
|
|
264
|
-
{
|
|
265
|
-
conditionalAssign: false,
|
|
266
|
-
nestedBinaryExpressions: false,
|
|
267
|
-
returnAssign: false,
|
|
268
|
-
ignoreJSX: 'all',
|
|
269
|
-
enforceForArrowConditionals: false,
|
|
270
|
-
enforceForSequenceExpressions: false,
|
|
271
|
-
enforceForNewInMemberExpressions: false,
|
|
272
|
-
enforceForFunctionPrototypeMethods: false,
|
|
273
|
-
},
|
|
274
|
-
],
|
|
275
|
-
|
|
276
|
-
// https://eslint.org/docs/rules/no-mixed-spaces-and-tabs
|
|
277
|
-
'no-mixed-spaces-and-tabs': 'error',
|
|
278
|
-
|
|
279
|
-
// https://eslint.org/docs/rules/no-multi-spaces
|
|
280
|
-
'no-multi-spaces': 'error',
|
|
281
|
-
|
|
282
|
-
// https://eslint.org/docs/rules/no-multiple-empty-lines
|
|
283
|
-
'no-multiple-empty-lines': [
|
|
284
|
-
'error',
|
|
285
|
-
{
|
|
286
|
-
max: config.noMultipleEmptyLinesMax,
|
|
287
|
-
maxEOF: config.noMultipleEmptyLinesEOF,
|
|
288
|
-
maxBOF: config.noMultipleEmptyLinesBOF,
|
|
289
|
-
},
|
|
290
|
-
],
|
|
291
|
-
|
|
292
|
-
// https://eslint.org/docs/rules/no-tabs
|
|
293
|
-
'no-tabs': 'error',
|
|
294
|
-
|
|
295
|
-
// https://eslint.org/docs/rules/no-trailing-space
|
|
296
|
-
'no-trailing-spaces': [
|
|
297
|
-
'error',
|
|
298
|
-
{
|
|
299
|
-
skipBlankLines: false,
|
|
300
|
-
ignoreComments: false,
|
|
301
|
-
},
|
|
302
|
-
],
|
|
303
|
-
|
|
304
|
-
// https://eslint.org/docs/rules/no-whitespace-before-property
|
|
305
|
-
'no-whitespace-before-property': 'error',
|
|
306
|
-
|
|
307
|
-
// https://eslint.org/docs/rules/nonblock-statement-body-position
|
|
308
|
-
'nonblock-statement-body-position': [
|
|
309
|
-
'error',
|
|
310
|
-
'beside',
|
|
311
|
-
{
|
|
312
|
-
overrides: {},
|
|
313
|
-
},
|
|
314
|
-
],
|
|
315
|
-
|
|
316
|
-
// https://eslint.org/docs/rules/object-curly-newline
|
|
317
|
-
'object-curly-newline': [
|
|
318
|
-
'error',
|
|
319
|
-
{
|
|
320
|
-
ObjectExpression: {
|
|
321
|
-
minProperties: config.newlineObjectExpressionMin,
|
|
322
|
-
multiline: true,
|
|
323
|
-
consistent: true,
|
|
324
|
-
},
|
|
325
|
-
ObjectPattern: {
|
|
326
|
-
minProperties: config.newlineObjectPatternMin,
|
|
327
|
-
multiline: true,
|
|
328
|
-
consistent: true,
|
|
329
|
-
},
|
|
330
|
-
ImportDeclaration: {
|
|
331
|
-
minProperties: config.newlineImportDeclarationMin,
|
|
332
|
-
multiline: true,
|
|
333
|
-
consistent: true,
|
|
334
|
-
},
|
|
335
|
-
ExportDeclaration: {
|
|
336
|
-
minProperties: config.newlineExportDeclarationMin,
|
|
337
|
-
multiline: true,
|
|
338
|
-
consistent: true,
|
|
339
|
-
},
|
|
340
|
-
},
|
|
341
|
-
],
|
|
342
|
-
|
|
343
|
-
// https://eslint.org/docs/rules/object-curly-spacing
|
|
344
|
-
'object-curly-spacing': [
|
|
345
|
-
'error',
|
|
346
|
-
'always',
|
|
347
|
-
{
|
|
348
|
-
arraysInObjects: true,
|
|
349
|
-
objectsInObjects: true,
|
|
350
|
-
},
|
|
351
|
-
],
|
|
352
|
-
|
|
353
|
-
// https://eslint.org/docs/rules/object-property-newline
|
|
354
|
-
'object-property-newline': [
|
|
355
|
-
'error',
|
|
356
|
-
{
|
|
357
|
-
allowAllPropertiesOnSameLine: false,
|
|
358
|
-
},
|
|
359
|
-
],
|
|
360
|
-
|
|
361
|
-
// https://eslint.org/docs/rules/operator-linebreak
|
|
362
|
-
'operator-linebreak': ['error', 'before', { overrides: { '=': 'none' } }],
|
|
363
|
-
|
|
364
|
-
// https://eslint.org/docs/rules/padded-blocks
|
|
365
|
-
'padded-blocks': [
|
|
366
|
-
'error',
|
|
367
|
-
{
|
|
368
|
-
blocks: 'never',
|
|
369
|
-
classes: 'never',
|
|
370
|
-
switches: 'never',
|
|
371
|
-
},
|
|
372
|
-
],
|
|
373
|
-
|
|
374
|
-
// https://eslint.org/docs/rules/padding-line-between-statements
|
|
375
|
-
'padding-line-between-statements': [
|
|
376
|
-
'error',
|
|
377
|
-
|
|
378
|
-
// following 2 lines are replacement for deprecated lines-around-directive https://eslint.org/docs/rules/lines-around-directive
|
|
379
|
-
{
|
|
380
|
-
blankLine: 'always',
|
|
381
|
-
prev: 'directive',
|
|
382
|
-
next: '*',
|
|
383
|
-
},
|
|
384
|
-
{
|
|
385
|
-
blankLine: 'any',
|
|
386
|
-
prev: 'directive',
|
|
387
|
-
next: 'directive',
|
|
388
|
-
},
|
|
389
|
-
|
|
390
|
-
// following 2 lines are replacement for deprecated newline-after-var https://eslint.org/docs/rules/newline-after-var
|
|
391
|
-
{
|
|
392
|
-
blankLine: 'always',
|
|
393
|
-
prev: ['const', 'let', 'var'],
|
|
394
|
-
next: '*',
|
|
395
|
-
},
|
|
396
|
-
{
|
|
397
|
-
blankLine: 'any',
|
|
398
|
-
prev: ['const', 'let', 'var'],
|
|
399
|
-
next: ['const', 'let', 'var'],
|
|
400
|
-
},
|
|
401
|
-
|
|
402
|
-
// following line are replacement for deprecated newline-before-return https://eslint.org/docs/rules/newline-before-return
|
|
403
|
-
{
|
|
404
|
-
blankLine: 'always',
|
|
405
|
-
prev: '*',
|
|
406
|
-
next: 'return',
|
|
407
|
-
},
|
|
408
|
-
],
|
|
409
|
-
|
|
410
|
-
// https://eslint.org/docs/rules/quotes
|
|
411
|
-
quotes: [
|
|
412
|
-
'error',
|
|
413
|
-
'single',
|
|
414
|
-
{
|
|
415
|
-
avoidEscape: true,
|
|
416
|
-
allowTemplateLiterals: true,
|
|
417
|
-
},
|
|
418
|
-
],
|
|
419
|
-
|
|
420
|
-
// https://eslint.org/docs/rules/rest-spread-spacing
|
|
421
|
-
'rest-spread-spacing': ['error', 'never'],
|
|
422
|
-
|
|
423
|
-
// https://eslint.org/docs/rules/semi
|
|
424
|
-
semi: ['error', 'always'],
|
|
425
|
-
|
|
426
|
-
// https://eslint.org/docs/rules/semi-spacing
|
|
427
|
-
'semi-spacing': [
|
|
428
|
-
'error',
|
|
429
|
-
{
|
|
430
|
-
before: false,
|
|
431
|
-
after: true,
|
|
432
|
-
},
|
|
433
|
-
],
|
|
434
|
-
|
|
435
|
-
// https://eslint.org/docs/rules/semi-style
|
|
436
|
-
'semi-style': ['error', 'last'],
|
|
437
|
-
|
|
438
|
-
// https://eslint.org/docs/rules/space-before-blocks
|
|
439
|
-
'space-before-blocks': 'error',
|
|
440
|
-
|
|
441
|
-
// https://eslint.org/docs/rules/space-before-function-paren
|
|
442
|
-
'space-before-function-paren': [
|
|
443
|
-
'error',
|
|
444
|
-
{
|
|
445
|
-
anonymous: 'never',
|
|
446
|
-
named: 'never',
|
|
447
|
-
asyncArrow: 'always',
|
|
448
|
-
},
|
|
449
|
-
],
|
|
450
|
-
|
|
451
|
-
// https://eslint.org/docs/rules/space-in-parens
|
|
452
|
-
'space-in-parens': ['error', 'never'],
|
|
453
|
-
|
|
454
|
-
// https://eslint.org/docs/rules/space-infix-ops
|
|
455
|
-
'space-infix-ops': 'error',
|
|
456
|
-
|
|
457
|
-
// https://eslint.org/docs/rules/space-unary-ops
|
|
458
|
-
'space-unary-ops': [
|
|
459
|
-
'error',
|
|
460
|
-
{
|
|
461
|
-
words: true,
|
|
462
|
-
nonwords: false,
|
|
463
|
-
overrides: {},
|
|
464
|
-
},
|
|
465
|
-
],
|
|
466
|
-
|
|
467
|
-
// https://eslint.org/docs/rules/switch-colon-spacing
|
|
468
|
-
'switch-colon-spacing': [
|
|
469
|
-
'error',
|
|
470
|
-
{
|
|
471
|
-
after: true,
|
|
472
|
-
before: false,
|
|
473
|
-
},
|
|
474
|
-
],
|
|
475
|
-
|
|
476
|
-
// https://eslint.org/docs/rules/template-curly-spacing
|
|
477
|
-
'template-curly-spacing': 'error',
|
|
478
|
-
|
|
479
|
-
// https://eslint.org/docs/rules/template-tag-spacing
|
|
480
|
-
'template-tag-spacing': ['error', 'never'],
|
|
481
|
-
|
|
482
15
|
// https://eslint.org/docs/rules/unicode-bom
|
|
483
16
|
'unicode-bom': ['error', 'never'],
|
|
484
|
-
|
|
485
|
-
// https://eslint.org/docs/rules/wrap-iife.html
|
|
486
|
-
'wrap-iife': [
|
|
487
|
-
'error',
|
|
488
|
-
'outside',
|
|
489
|
-
{
|
|
490
|
-
functionPrototypeMethods: false,
|
|
491
|
-
},
|
|
492
|
-
],
|
|
493
|
-
|
|
494
|
-
// https://eslint.org/docs/rules/wrap-regex
|
|
495
|
-
'wrap-regex': 'error',
|
|
496
|
-
|
|
497
|
-
// https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/es6.js
|
|
498
|
-
'yield-star-spacing': ['error', 'after'],
|
|
499
17
|
},
|
|
500
18
|
};
|
|
@@ -211,15 +211,6 @@ module.exports = {
|
|
|
211
211
|
// https://eslint.org/docs/rules/no-case-declarations
|
|
212
212
|
'no-case-declarations': 'error',
|
|
213
213
|
|
|
214
|
-
// https://eslint.org/docs/rules/no-confusing-arrow
|
|
215
|
-
'no-confusing-arrow': [
|
|
216
|
-
'error',
|
|
217
|
-
{
|
|
218
|
-
allowParens: false,
|
|
219
|
-
onlyOneSimpleParam: false,
|
|
220
|
-
},
|
|
221
|
-
],
|
|
222
|
-
|
|
223
214
|
// https://eslint.org/docs/rules/no-console
|
|
224
215
|
'no-console': 'error',
|
|
225
216
|
|
|
@@ -272,12 +263,6 @@ module.exports = {
|
|
|
272
263
|
// https://eslint.org/docs/rules/no-extra-label
|
|
273
264
|
'no-extra-label': 'error',
|
|
274
265
|
|
|
275
|
-
// https://eslint.org/docs/rules/no-extra-semi
|
|
276
|
-
'no-extra-semi': 'error',
|
|
277
|
-
|
|
278
|
-
// https://eslint.org/docs/rules/no-floating-decimal
|
|
279
|
-
'no-floating-decimal': 'error',
|
|
280
|
-
|
|
281
266
|
// https://eslint.org/docs/rules/no-global-assign
|
|
282
267
|
'no-global-assign': [
|
|
283
268
|
'error',
|
|
@@ -331,21 +316,6 @@ module.exports = {
|
|
|
331
316
|
},
|
|
332
317
|
],
|
|
333
318
|
|
|
334
|
-
// https://eslint.org/docs/rules/no-mixed-operators
|
|
335
|
-
'no-mixed-operators': [
|
|
336
|
-
'error',
|
|
337
|
-
{
|
|
338
|
-
groups: [
|
|
339
|
-
['+', '-', '*', '/', '%', '**'],
|
|
340
|
-
['&', '|', '^', '~', '<<', '>>', '>>>'],
|
|
341
|
-
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
|
|
342
|
-
['&&', '||'],
|
|
343
|
-
['in', 'instanceof'],
|
|
344
|
-
],
|
|
345
|
-
allowSamePrecedence: true,
|
|
346
|
-
},
|
|
347
|
-
],
|
|
348
|
-
|
|
349
319
|
// https://eslint.org/docs/rules/no-multi-assign
|
|
350
320
|
'no-multi-assign': 'error',
|
|
351
321
|
|
|
@@ -609,9 +579,6 @@ module.exports = {
|
|
|
609
579
|
// https://eslint.org/docs/rules/one-var
|
|
610
580
|
'one-var': ['error', 'never'],
|
|
611
581
|
|
|
612
|
-
// https://eslint.org/docs/rules/one-var-declaration-per-line
|
|
613
|
-
'one-var-declaration-per-line': ['error', 'initializations'],
|
|
614
|
-
|
|
615
582
|
// https://eslint.org/docs/rules/operator-assignment
|
|
616
583
|
'operator-assignment': ['error', 'never'],
|
|
617
584
|
|
|
@@ -689,17 +656,6 @@ module.exports = {
|
|
|
689
656
|
// https://eslint.org/docs/rules/prefer-template
|
|
690
657
|
'prefer-template': 'error',
|
|
691
658
|
|
|
692
|
-
// https://eslint.org/docs/rules/quote-props.html
|
|
693
|
-
'quote-props': [
|
|
694
|
-
'error',
|
|
695
|
-
'as-needed',
|
|
696
|
-
{
|
|
697
|
-
keywords: false,
|
|
698
|
-
unnecessary: true,
|
|
699
|
-
numbers: false,
|
|
700
|
-
},
|
|
701
|
-
],
|
|
702
|
-
|
|
703
659
|
// https://eslint.org/docs/rules/radix
|
|
704
660
|
radix: 'error',
|
|
705
661
|
|
|
@@ -733,9 +689,6 @@ module.exports = {
|
|
|
733
689
|
},
|
|
734
690
|
],
|
|
735
691
|
|
|
736
|
-
// https://eslint.org/docs/rules/spaced-comment
|
|
737
|
-
'spaced-comment': ['error', 'always'],
|
|
738
|
-
|
|
739
692
|
// https://eslint.org/docs/rules/strict
|
|
740
693
|
strict: ['error', 'never'],
|
|
741
694
|
|
|
@@ -0,0 +1,530 @@
|
|
|
1
|
+
// https://eslint.style/packages/js
|
|
2
|
+
|
|
3
|
+
const config = require('../config');
|
|
4
|
+
|
|
5
|
+
module.exports = {
|
|
6
|
+
plugins: ['@stylistic/js'],
|
|
7
|
+
|
|
8
|
+
rules: {
|
|
9
|
+
// https://eslint.style/rules/js/array-bracket-newline
|
|
10
|
+
'@stylistic/js/array-bracket-newline': ['error', 'consistent'],
|
|
11
|
+
|
|
12
|
+
// https://eslint.style/rules/js/array-bracket-spacing
|
|
13
|
+
'@stylistic/js/array-bracket-spacing': ['error', 'never'],
|
|
14
|
+
|
|
15
|
+
// https://eslint.style/rules/js/array-element-newline
|
|
16
|
+
'@stylistic/js/array-element-newline': 'off',
|
|
17
|
+
|
|
18
|
+
// https://eslint.style/rules/js/arrow-parens
|
|
19
|
+
'@stylistic/js/arrow-parens': ['error', 'always'],
|
|
20
|
+
|
|
21
|
+
// https://eslint.style/rules/js/arrow-spacing
|
|
22
|
+
'@stylistic/js/arrow-spacing': [
|
|
23
|
+
'error',
|
|
24
|
+
{
|
|
25
|
+
before: true,
|
|
26
|
+
after: true,
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
|
|
30
|
+
// https://eslint.style/rules/js/block-spacing
|
|
31
|
+
'@stylistic/js/block-spacing': ['error', 'always'],
|
|
32
|
+
|
|
33
|
+
// https://eslint.style/rules/js/brace-style
|
|
34
|
+
'@stylistic/js/brace-style': [
|
|
35
|
+
'error',
|
|
36
|
+
'1tbs',
|
|
37
|
+
{
|
|
38
|
+
allowSingleLine: false,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
|
|
42
|
+
// https://eslint.style/rules/js/comma-dangle
|
|
43
|
+
'@stylistic/js/comma-dangle': [
|
|
44
|
+
'error',
|
|
45
|
+
{
|
|
46
|
+
arrays: 'always-multiline',
|
|
47
|
+
objects: 'always-multiline',
|
|
48
|
+
imports: 'always-multiline',
|
|
49
|
+
exports: 'always-multiline',
|
|
50
|
+
functions: 'never',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
|
|
54
|
+
// https://eslint.style/rules/js/comma-spacing
|
|
55
|
+
'@stylistic/js/comma-spacing': [
|
|
56
|
+
'error',
|
|
57
|
+
{
|
|
58
|
+
before: false,
|
|
59
|
+
after: true,
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
|
|
63
|
+
// https://eslint.style/rules/js/comma-style
|
|
64
|
+
'@stylistic/js/comma-style': [
|
|
65
|
+
'error',
|
|
66
|
+
'last',
|
|
67
|
+
{
|
|
68
|
+
exceptions: {
|
|
69
|
+
ArrayExpression: false,
|
|
70
|
+
ArrayPattern: false,
|
|
71
|
+
ArrowFunctionExpression: false,
|
|
72
|
+
CallExpression: false,
|
|
73
|
+
FunctionDeclaration: false,
|
|
74
|
+
FunctionExpression: false,
|
|
75
|
+
ImportDeclaration: false,
|
|
76
|
+
ObjectExpression: false,
|
|
77
|
+
ObjectPattern: false,
|
|
78
|
+
VariableDeclaration: false,
|
|
79
|
+
NewExpression: false,
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
|
|
84
|
+
// https://eslint.style/rules/js/computed-property-spacing
|
|
85
|
+
'@stylistic/js/computed-property-spacing': ['error', 'never'],
|
|
86
|
+
|
|
87
|
+
// https://eslint.style/rules/js/dot-location
|
|
88
|
+
'@stylistic/js/dot-location': ['error', 'property'],
|
|
89
|
+
|
|
90
|
+
// https://eslint.style/rules/js/eol-last
|
|
91
|
+
'@stylistic/js/eol-last': ['error', 'always'],
|
|
92
|
+
|
|
93
|
+
// https://eslint.style/rules/js/func-call-spacing
|
|
94
|
+
'@stylistic/js/func-call-spacing': ['error', 'never'],
|
|
95
|
+
|
|
96
|
+
/*
|
|
97
|
+
* TODO Enable when fixed for arrow functions
|
|
98
|
+
* https://eslint.style/rules/js/function-call-argument-newline
|
|
99
|
+
*/
|
|
100
|
+
'@stylistic/js/function-call-argument-newline': 'off',
|
|
101
|
+
|
|
102
|
+
// https://eslint.style/rules/js/function-paren-newline
|
|
103
|
+
'@stylistic/js/function-paren-newline': ['error', 'consistent'],
|
|
104
|
+
|
|
105
|
+
// https://eslint.style/rules/js/generator-star-spacing
|
|
106
|
+
'@stylistic/js/generator-star-spacing': [
|
|
107
|
+
'error',
|
|
108
|
+
{
|
|
109
|
+
before: false,
|
|
110
|
+
after: true,
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
|
|
114
|
+
// https://eslint.style/rules/js/implicit-arrow-linebreak
|
|
115
|
+
'@stylistic/js/implicit-arrow-linebreak': ['error', 'beside'],
|
|
116
|
+
|
|
117
|
+
// https://eslint.style/rules/js/indent
|
|
118
|
+
'@stylistic/js/indent': [
|
|
119
|
+
'error',
|
|
120
|
+
config.indent,
|
|
121
|
+
{
|
|
122
|
+
SwitchCase: 1,
|
|
123
|
+
VariableDeclarator: 1,
|
|
124
|
+
outerIIFEBody: 1,
|
|
125
|
+
MemberExpression: 0,
|
|
126
|
+
FunctionDeclaration: {
|
|
127
|
+
parameters: 1,
|
|
128
|
+
body: 1,
|
|
129
|
+
},
|
|
130
|
+
FunctionExpression: {
|
|
131
|
+
parameters: 1,
|
|
132
|
+
body: 1,
|
|
133
|
+
},
|
|
134
|
+
CallExpression: {
|
|
135
|
+
arguments: 1,
|
|
136
|
+
},
|
|
137
|
+
ArrayExpression: 1,
|
|
138
|
+
ObjectExpression: 1,
|
|
139
|
+
ImportDeclaration: 1,
|
|
140
|
+
flatTernaryExpressions: false,
|
|
141
|
+
offsetTernaryExpressions: false,
|
|
142
|
+
ignoredNodes: [],
|
|
143
|
+
ignoreComments: false,
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
|
|
147
|
+
// https://eslint.style/rules/js/jsx-quotes
|
|
148
|
+
'@stylistic/js/jsx-quotes': ['error', 'prefer-double'],
|
|
149
|
+
|
|
150
|
+
// https://eslint.style/rules/js/key-spacing
|
|
151
|
+
'@stylistic/js/key-spacing': [
|
|
152
|
+
'error',
|
|
153
|
+
{
|
|
154
|
+
beforeColon: false,
|
|
155
|
+
afterColon: true,
|
|
156
|
+
mode: 'strict',
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
|
|
160
|
+
// https://eslint.style/rules/js/keyword-spacing
|
|
161
|
+
'@stylistic/js/keyword-spacing': [
|
|
162
|
+
'error',
|
|
163
|
+
{
|
|
164
|
+
before: true,
|
|
165
|
+
after: true,
|
|
166
|
+
overrides: {
|
|
167
|
+
return: {
|
|
168
|
+
after: true,
|
|
169
|
+
},
|
|
170
|
+
throw: {
|
|
171
|
+
after: true,
|
|
172
|
+
},
|
|
173
|
+
case: {
|
|
174
|
+
after: true,
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
|
|
180
|
+
// https://eslint.style/rules/js/linebreak-style
|
|
181
|
+
'@stylistic/js/linebreak-style': ['error', 'unix'],
|
|
182
|
+
|
|
183
|
+
// https://eslint.style/rules/js/lines-around-comment
|
|
184
|
+
'@stylistic/js/lines-around-comment': [
|
|
185
|
+
'error',
|
|
186
|
+
{
|
|
187
|
+
beforeBlockComment: true,
|
|
188
|
+
afterBlockComment: false,
|
|
189
|
+
beforeLineComment: true,
|
|
190
|
+
afterLineComment: false,
|
|
191
|
+
allowBlockStart: true,
|
|
192
|
+
allowBlockEnd: false,
|
|
193
|
+
allowObjectStart: true,
|
|
194
|
+
allowObjectEnd: false,
|
|
195
|
+
allowArrayStart: false,
|
|
196
|
+
allowArrayEnd: false,
|
|
197
|
+
allowClassStart: true,
|
|
198
|
+
allowClassEnd: false,
|
|
199
|
+
applyDefaultIgnorePatterns: true,
|
|
200
|
+
ignorePattern: '@ts-expect-error',
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
|
|
204
|
+
// https://eslint.style/rules/js/lines-between-class-members
|
|
205
|
+
'@stylistic/js/lines-between-class-members': [
|
|
206
|
+
'error',
|
|
207
|
+
'always',
|
|
208
|
+
{
|
|
209
|
+
exceptAfterSingleLine: false,
|
|
210
|
+
},
|
|
211
|
+
],
|
|
212
|
+
|
|
213
|
+
// https://eslint.style/rules/js/max-len
|
|
214
|
+
'@stylistic/js/max-len': [
|
|
215
|
+
'error',
|
|
216
|
+
{
|
|
217
|
+
code: config.maxLen,
|
|
218
|
+
tabWidth: config.indent,
|
|
219
|
+
comments: config.maxLen,
|
|
220
|
+
ignorePattern: 'ignore-long-line',
|
|
221
|
+
ignoreComments: false,
|
|
222
|
+
ignoreTrailingComments: false,
|
|
223
|
+
ignoreRegExpLiterals: false,
|
|
224
|
+
ignoreStrings: false,
|
|
225
|
+
ignoreTemplateLiterals: false,
|
|
226
|
+
ignoreUrls: true,
|
|
227
|
+
},
|
|
228
|
+
],
|
|
229
|
+
|
|
230
|
+
// https://eslint.style/rules/js/max-statements-per-line
|
|
231
|
+
'@stylistic/js/max-statements-per-line': [
|
|
232
|
+
'error',
|
|
233
|
+
{
|
|
234
|
+
max: config.maxStatementsPerLine,
|
|
235
|
+
},
|
|
236
|
+
],
|
|
237
|
+
|
|
238
|
+
// https://eslint.style/rules/js/multiline-ternary
|
|
239
|
+
'@stylistic/js/multiline-ternary': 'off',
|
|
240
|
+
|
|
241
|
+
// https://eslint.style/rules/js/new-parens
|
|
242
|
+
'@stylistic/js/new-parens': 'error',
|
|
243
|
+
|
|
244
|
+
// https://eslint.style/rules/js/newline-per-chained-call
|
|
245
|
+
'@stylistic/js/newline-per-chained-call': [
|
|
246
|
+
'error',
|
|
247
|
+
{
|
|
248
|
+
ignoreChainWithDepth: 2,
|
|
249
|
+
},
|
|
250
|
+
],
|
|
251
|
+
|
|
252
|
+
// https://eslint.style/rules/js/no-confusing-arrow
|
|
253
|
+
'@stylistic/js/no-confusing-arrow': [
|
|
254
|
+
'error',
|
|
255
|
+
{
|
|
256
|
+
allowParens: false,
|
|
257
|
+
onlyOneSimpleParam: false,
|
|
258
|
+
},
|
|
259
|
+
],
|
|
260
|
+
|
|
261
|
+
// https://eslint.style/rules/js/no-extra-parens
|
|
262
|
+
'@stylistic/js/no-extra-parens': [
|
|
263
|
+
'error',
|
|
264
|
+
'all',
|
|
265
|
+
{
|
|
266
|
+
conditionalAssign: false,
|
|
267
|
+
nestedBinaryExpressions: false,
|
|
268
|
+
returnAssign: false,
|
|
269
|
+
ignoreJSX: 'all',
|
|
270
|
+
enforceForArrowConditionals: false,
|
|
271
|
+
enforceForSequenceExpressions: false,
|
|
272
|
+
enforceForNewInMemberExpressions: false,
|
|
273
|
+
enforceForFunctionPrototypeMethods: false,
|
|
274
|
+
},
|
|
275
|
+
],
|
|
276
|
+
|
|
277
|
+
// https://eslint.style/rules/js/no-extra-semi
|
|
278
|
+
'@stylistic/js/no-extra-semi': 'error',
|
|
279
|
+
|
|
280
|
+
// https://eslint.style/rules/js/no-floating-decimal
|
|
281
|
+
'@stylistic/js/no-floating-decimal': 'error',
|
|
282
|
+
|
|
283
|
+
// https://eslint.style/rules/js/no-mixed-operators
|
|
284
|
+
'@stylistic/js/no-mixed-operators': [
|
|
285
|
+
'error',
|
|
286
|
+
{
|
|
287
|
+
groups: [
|
|
288
|
+
['+', '-', '*', '/', '%', '**'],
|
|
289
|
+
['&', '|', '^', '~', '<<', '>>', '>>>'],
|
|
290
|
+
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
|
|
291
|
+
['&&', '||'],
|
|
292
|
+
['in', 'instanceof'],
|
|
293
|
+
],
|
|
294
|
+
allowSamePrecedence: true,
|
|
295
|
+
},
|
|
296
|
+
],
|
|
297
|
+
|
|
298
|
+
// https://eslint.style/rules/js/no-mixed-spaces-and-tabs
|
|
299
|
+
'@stylistic/js/no-mixed-spaces-and-tabs': 'error',
|
|
300
|
+
|
|
301
|
+
// https://eslint.style/rules/js/no-multi-spaces
|
|
302
|
+
'@stylistic/js/no-multi-spaces': 'error',
|
|
303
|
+
|
|
304
|
+
// https://eslint.style/rules/js/no-multiple-empty-lines
|
|
305
|
+
'@stylistic/js/no-multiple-empty-lines': [
|
|
306
|
+
'error',
|
|
307
|
+
{
|
|
308
|
+
max: config.noMultipleEmptyLinesMax,
|
|
309
|
+
maxEOF: config.noMultipleEmptyLinesEOF,
|
|
310
|
+
maxBOF: config.noMultipleEmptyLinesBOF,
|
|
311
|
+
},
|
|
312
|
+
],
|
|
313
|
+
|
|
314
|
+
// https://eslint.style/rules/js/no-tabs
|
|
315
|
+
'@stylistic/js/no-tabs': 'error',
|
|
316
|
+
|
|
317
|
+
// https://eslint.style/rules/js/no-trailing-spaces
|
|
318
|
+
'@stylistic/js/no-trailing-spaces': [
|
|
319
|
+
'error',
|
|
320
|
+
{
|
|
321
|
+
skipBlankLines: false,
|
|
322
|
+
ignoreComments: false,
|
|
323
|
+
},
|
|
324
|
+
],
|
|
325
|
+
|
|
326
|
+
// https://eslint.style/rules/js/no-whitespace-before-property
|
|
327
|
+
'@stylistic/js/no-whitespace-before-property': 'error',
|
|
328
|
+
|
|
329
|
+
// https://eslint.style/rules/js/nonblock-statement-body-position
|
|
330
|
+
'@stylistic/js/nonblock-statement-body-position': [
|
|
331
|
+
'error',
|
|
332
|
+
'beside',
|
|
333
|
+
{
|
|
334
|
+
overrides: {},
|
|
335
|
+
},
|
|
336
|
+
],
|
|
337
|
+
|
|
338
|
+
// https://eslint.style/rules/js/object-curly-newline
|
|
339
|
+
'@stylistic/js/object-curly-newline': [
|
|
340
|
+
'error',
|
|
341
|
+
{
|
|
342
|
+
ObjectExpression: {
|
|
343
|
+
minProperties: config.newlineObjectExpressionMin,
|
|
344
|
+
multiline: true,
|
|
345
|
+
consistent: true,
|
|
346
|
+
},
|
|
347
|
+
ObjectPattern: {
|
|
348
|
+
minProperties: config.newlineObjectPatternMin,
|
|
349
|
+
multiline: true,
|
|
350
|
+
consistent: true,
|
|
351
|
+
},
|
|
352
|
+
ImportDeclaration: {
|
|
353
|
+
minProperties: config.newlineImportDeclarationMin,
|
|
354
|
+
multiline: true,
|
|
355
|
+
consistent: true,
|
|
356
|
+
},
|
|
357
|
+
ExportDeclaration: {
|
|
358
|
+
minProperties: config.newlineExportDeclarationMin,
|
|
359
|
+
multiline: true,
|
|
360
|
+
consistent: true,
|
|
361
|
+
},
|
|
362
|
+
},
|
|
363
|
+
],
|
|
364
|
+
|
|
365
|
+
// https://eslint.style/rules/js/object-curly-spacing
|
|
366
|
+
'@stylistic/js/object-curly-spacing': [
|
|
367
|
+
'error',
|
|
368
|
+
'always',
|
|
369
|
+
{
|
|
370
|
+
arraysInObjects: true,
|
|
371
|
+
objectsInObjects: true,
|
|
372
|
+
},
|
|
373
|
+
],
|
|
374
|
+
|
|
375
|
+
// https://eslint.style/rules/js/object-property-newline
|
|
376
|
+
'@stylistic/js/object-property-newline': [
|
|
377
|
+
'error',
|
|
378
|
+
{
|
|
379
|
+
allowAllPropertiesOnSameLine: false,
|
|
380
|
+
},
|
|
381
|
+
],
|
|
382
|
+
|
|
383
|
+
// https://eslint.style/rules/js/one-var-declaration-per-line
|
|
384
|
+
'@stylistic/js/one-var-declaration-per-line': ['error', 'initializations'],
|
|
385
|
+
|
|
386
|
+
// https://eslint.style/rules/js/operator-linebreak
|
|
387
|
+
'@stylistic/js/operator-linebreak': ['error', 'before', { overrides: { '=': 'none' } }],
|
|
388
|
+
|
|
389
|
+
// https://eslint.style/rules/js/padded-blocks
|
|
390
|
+
'@stylistic/js/padded-blocks': [
|
|
391
|
+
'error',
|
|
392
|
+
{
|
|
393
|
+
blocks: 'never',
|
|
394
|
+
classes: 'never',
|
|
395
|
+
switches: 'never',
|
|
396
|
+
},
|
|
397
|
+
],
|
|
398
|
+
|
|
399
|
+
// https://eslint.style/rules/js/padding-line-between-statements
|
|
400
|
+
'@stylistic/js/padding-line-between-statements': [
|
|
401
|
+
'error',
|
|
402
|
+
{
|
|
403
|
+
blankLine: 'always',
|
|
404
|
+
prev: 'directive',
|
|
405
|
+
next: '*',
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
blankLine: 'any',
|
|
409
|
+
prev: 'directive',
|
|
410
|
+
next: 'directive',
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
blankLine: 'always',
|
|
414
|
+
prev: ['const', 'let', 'var'],
|
|
415
|
+
next: '*',
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
blankLine: 'any',
|
|
419
|
+
prev: ['const', 'let', 'var'],
|
|
420
|
+
next: ['const', 'let', 'var'],
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
blankLine: 'always',
|
|
424
|
+
prev: '*',
|
|
425
|
+
next: 'return',
|
|
426
|
+
},
|
|
427
|
+
],
|
|
428
|
+
|
|
429
|
+
// https://eslint.style/rules/js/quote-props
|
|
430
|
+
'@stylistic/js/quote-props': [
|
|
431
|
+
'error',
|
|
432
|
+
'as-needed',
|
|
433
|
+
{
|
|
434
|
+
keywords: false,
|
|
435
|
+
unnecessary: true,
|
|
436
|
+
numbers: false,
|
|
437
|
+
},
|
|
438
|
+
],
|
|
439
|
+
|
|
440
|
+
// https://eslint.style/rules/js/quotes
|
|
441
|
+
'@stylistic/js/quotes': [
|
|
442
|
+
'error',
|
|
443
|
+
'single',
|
|
444
|
+
{
|
|
445
|
+
avoidEscape: true,
|
|
446
|
+
allowTemplateLiterals: true,
|
|
447
|
+
},
|
|
448
|
+
],
|
|
449
|
+
|
|
450
|
+
// https://eslint.style/rules/js/rest-spread-spacing
|
|
451
|
+
'@stylistic/js/rest-spread-spacing': ['error', 'never'],
|
|
452
|
+
|
|
453
|
+
// https://eslint.style/rules/js/semi
|
|
454
|
+
'@stylistic/js/semi': ['error', 'always'],
|
|
455
|
+
|
|
456
|
+
// https://eslint.style/rules/js/semi-spacing
|
|
457
|
+
'@stylistic/js/semi-spacing': [
|
|
458
|
+
'error',
|
|
459
|
+
{
|
|
460
|
+
before: false,
|
|
461
|
+
after: true,
|
|
462
|
+
},
|
|
463
|
+
],
|
|
464
|
+
|
|
465
|
+
// https://eslint.style/rules/js/semi-style
|
|
466
|
+
'@stylistic/js/semi-style': ['error', 'last'],
|
|
467
|
+
|
|
468
|
+
// https://eslint.style/rules/js/space-before-blocks
|
|
469
|
+
'@stylistic/js/space-before-blocks': 'error',
|
|
470
|
+
|
|
471
|
+
// https://eslint.style/rules/js/space-before-function-paren
|
|
472
|
+
'@stylistic/js/space-before-function-paren': [
|
|
473
|
+
'error',
|
|
474
|
+
{
|
|
475
|
+
anonymous: 'never',
|
|
476
|
+
named: 'never',
|
|
477
|
+
asyncArrow: 'always',
|
|
478
|
+
},
|
|
479
|
+
],
|
|
480
|
+
|
|
481
|
+
// https://eslint.style/rules/js/space-in-parens
|
|
482
|
+
'@stylistic/js/space-in-parens': ['error', 'never'],
|
|
483
|
+
|
|
484
|
+
// https://eslint.style/rules/js/space-infix-ops
|
|
485
|
+
'@stylistic/js/space-infix-ops': 'error',
|
|
486
|
+
|
|
487
|
+
// https://eslint.style/rules/js/space-unary-ops
|
|
488
|
+
'@stylistic/js/space-unary-ops': [
|
|
489
|
+
'error',
|
|
490
|
+
{
|
|
491
|
+
words: true,
|
|
492
|
+
nonwords: false,
|
|
493
|
+
overrides: {},
|
|
494
|
+
},
|
|
495
|
+
],
|
|
496
|
+
|
|
497
|
+
// https://eslint.style/rules/js/spaced-comment
|
|
498
|
+
'@stylistic/js/spaced-comment': ['error', 'always'],
|
|
499
|
+
|
|
500
|
+
// https://eslint.style/rules/js/switch-colon-spacing
|
|
501
|
+
'@stylistic/js/switch-colon-spacing': [
|
|
502
|
+
'error',
|
|
503
|
+
{
|
|
504
|
+
after: true,
|
|
505
|
+
before: false,
|
|
506
|
+
},
|
|
507
|
+
],
|
|
508
|
+
|
|
509
|
+
// https://eslint.style/rules/js/template-curly-spacing
|
|
510
|
+
'@stylistic/js/template-curly-spacing': 'error',
|
|
511
|
+
|
|
512
|
+
// https://eslint.style/rules/js/template-tag-spacing
|
|
513
|
+
'@stylistic/js/template-tag-spacing': ['error', 'never'],
|
|
514
|
+
|
|
515
|
+
// https://eslint.style/rules/js/wrap-iife
|
|
516
|
+
'@stylistic/js/wrap-iife': [
|
|
517
|
+
'error',
|
|
518
|
+
'outside',
|
|
519
|
+
{
|
|
520
|
+
functionPrototypeMethods: false,
|
|
521
|
+
},
|
|
522
|
+
],
|
|
523
|
+
|
|
524
|
+
// https://eslint.style/rules/js/wrap-regex
|
|
525
|
+
'@stylistic/js/wrap-regex': 'error',
|
|
526
|
+
|
|
527
|
+
// https://eslint.style/rules/js/yield-star-spacing
|
|
528
|
+
'@stylistic/js/yield-star-spacing': ['error', 'after'],
|
|
529
|
+
},
|
|
530
|
+
};
|