@sequencemedia/eslint-config-standard 0.1.6 → 0.2.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 +60 -1
- package/configs/index.mjs +20 -0
- package/configs/recommended.mjs +20 -0
- package/{config → configs}/standard.mjs +166 -46
- package/configs/stylistic.mjs +327 -0
- package/index.mjs +13 -3
- package/merge/recommended.mjs +12 -0
- package/merge/standard.mjs +1 -1
- package/merge/stylistic.mjs +1 -1
- package/merge.mjs +14 -1
- package/package.json +5 -4
- package/test/common/index.spec.mjs +2 -2
- package/test/configs/index.spec.mjs +17 -0
- package/test/configs/recommended.spec.mjs +9 -0
- package/test/configs/standard.spec.mjs +9 -0
- package/test/configs/stylistic.spec.mjs +9 -0
- package/test/merge/recommended.spec.mjs +63 -0
- package/test/merge/standard.spec.mjs +1 -1
- package/test/merge/stylistic.spec.mjs +1 -1
- package/test/merge.spec.mjs +18 -13
- package/common/merge.mjs +0 -82
- package/config/stylistic.mjs +0 -91
package/README.md
CHANGED
|
@@ -1,3 +1,62 @@
|
|
|
1
1
|
# `@sequencemedia/eslint-config-standard`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Standard style Flat Config for ESLint `v9`
|
|
4
|
+
|
|
5
|
+
Based on [Standard](https://github.com/standard/eslint-config-standard) via [neostandard](https://github.com/neostandard/neostandard)
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```shell
|
|
10
|
+
npm i -D @sequencemedia/eslint-config-standard
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Use
|
|
14
|
+
|
|
15
|
+
In your `eslint.config.*` either:
|
|
16
|
+
|
|
17
|
+
```javascript
|
|
18
|
+
export { default } from '@sequencemedia/eslint-config-standard'
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Or:
|
|
22
|
+
|
|
23
|
+
```javascript
|
|
24
|
+
import { configs } from '@sequencemedia/eslint-config-standard'
|
|
25
|
+
|
|
26
|
+
export default [
|
|
27
|
+
configs.recommended
|
|
28
|
+
]
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
You can merge _changes_ in the default configuration using the `merge` utility:
|
|
32
|
+
|
|
33
|
+
```javascript
|
|
34
|
+
import merge from '@sequencemedia/eslint-config-standard/merge'
|
|
35
|
+
|
|
36
|
+
export default merge({
|
|
37
|
+
files: [
|
|
38
|
+
'**/*.{mjs,cjs}'
|
|
39
|
+
],
|
|
40
|
+
ignores: [
|
|
41
|
+
'lib'
|
|
42
|
+
]
|
|
43
|
+
})
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Which is _equivalent to_:
|
|
47
|
+
|
|
48
|
+
```javascript
|
|
49
|
+
import { configs } from '@sequencemedia/eslint-config-standard'
|
|
50
|
+
|
|
51
|
+
export default [
|
|
52
|
+
{
|
|
53
|
+
...configs.recommended,
|
|
54
|
+
files: [
|
|
55
|
+
'**/*.{mjs,cjs}'
|
|
56
|
+
],
|
|
57
|
+
ignores: [
|
|
58
|
+
'lib'
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import recommended from './recommended.mjs'
|
|
2
|
+
import standard from './standard.mjs'
|
|
3
|
+
import stylistic from './stylistic.mjs'
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
export { default as recommended } from './recommended.mjs'
|
|
7
|
+
export { default as standard } from './standard.mjs'
|
|
8
|
+
export { default as stylistic } from './stylistic.mjs' */
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
recommended,
|
|
12
|
+
standard,
|
|
13
|
+
stylistic
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
recommended,
|
|
18
|
+
standard,
|
|
19
|
+
stylistic
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import standard from './standard.mjs'
|
|
2
|
+
import stylistic from './stylistic.mjs'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
name: '@sequencemedia/eslint-config-standard/recommended',
|
|
6
|
+
languageOptions: {
|
|
7
|
+
ecmaVersion: 'latest'
|
|
8
|
+
},
|
|
9
|
+
files: [
|
|
10
|
+
'**/*.{js,mjs,cjs}'
|
|
11
|
+
],
|
|
12
|
+
plugins: {
|
|
13
|
+
...standard.plugins,
|
|
14
|
+
...stylistic.plugins
|
|
15
|
+
},
|
|
16
|
+
rules: {
|
|
17
|
+
...standard.rules,
|
|
18
|
+
...stylistic.rules
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -14,23 +14,57 @@ export default {
|
|
|
14
14
|
* Standard
|
|
15
15
|
*/
|
|
16
16
|
'no-var': 'warn',
|
|
17
|
-
'object-shorthand': [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
'object-shorthand': [
|
|
18
|
+
'warn',
|
|
19
|
+
'properties'
|
|
20
|
+
],
|
|
21
|
+
'accessor-pairs': [
|
|
22
|
+
'error',
|
|
23
|
+
{
|
|
24
|
+
setWithoutGet: true,
|
|
25
|
+
enforceForClassMembers: true
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
'array-callback-return': [
|
|
29
|
+
'error',
|
|
30
|
+
{
|
|
31
|
+
allowImplicit: false,
|
|
32
|
+
checkForEach: false
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
camelcase: [
|
|
36
|
+
'error',
|
|
37
|
+
{
|
|
38
|
+
allow: [
|
|
39
|
+
'^UNSAFE_'
|
|
40
|
+
],
|
|
41
|
+
properties: 'never',
|
|
42
|
+
ignoreGlobals: true
|
|
43
|
+
}
|
|
44
|
+
],
|
|
28
45
|
'constructor-super': 'error',
|
|
29
|
-
curly: [
|
|
46
|
+
curly: [
|
|
47
|
+
'error',
|
|
48
|
+
'multi-line'
|
|
49
|
+
],
|
|
30
50
|
'default-case-last': 'error',
|
|
31
|
-
'dot-notation': [
|
|
32
|
-
|
|
33
|
-
|
|
51
|
+
'dot-notation': [
|
|
52
|
+
'error',
|
|
53
|
+
{ allowKeywords: true }
|
|
54
|
+
],
|
|
55
|
+
eqeqeq: [
|
|
56
|
+
'error',
|
|
57
|
+
'always',
|
|
58
|
+
{ null: 'ignore' }
|
|
59
|
+
],
|
|
60
|
+
'new-cap': [
|
|
61
|
+
'error',
|
|
62
|
+
{
|
|
63
|
+
newIsCap: true,
|
|
64
|
+
capIsNew: false,
|
|
65
|
+
properties: true
|
|
66
|
+
}
|
|
67
|
+
],
|
|
34
68
|
'no-array-constructor': 'error',
|
|
35
69
|
'no-async-promise-executor': 'error',
|
|
36
70
|
'no-caller': 'error',
|
|
@@ -39,7 +73,12 @@ export default {
|
|
|
39
73
|
'no-compare-neg-zero': 'error',
|
|
40
74
|
'no-cond-assign': 'error',
|
|
41
75
|
'no-const-assign': 'error',
|
|
42
|
-
'no-constant-condition': [
|
|
76
|
+
'no-constant-condition': [
|
|
77
|
+
'error',
|
|
78
|
+
{
|
|
79
|
+
checkLoops: false
|
|
80
|
+
}
|
|
81
|
+
],
|
|
43
82
|
'no-control-regex': 'error',
|
|
44
83
|
'no-debugger': 'error',
|
|
45
84
|
'no-delete-var': 'error',
|
|
@@ -48,7 +87,12 @@ export default {
|
|
|
48
87
|
'no-dupe-keys': 'error',
|
|
49
88
|
'no-duplicate-case': 'error',
|
|
50
89
|
'no-useless-backreference': 'error',
|
|
51
|
-
'no-empty': [
|
|
90
|
+
'no-empty': [
|
|
91
|
+
'error',
|
|
92
|
+
{
|
|
93
|
+
allowEmptyCatch: true
|
|
94
|
+
}
|
|
95
|
+
],
|
|
52
96
|
'no-empty-character-class': 'error',
|
|
53
97
|
'no-empty-pattern': 'error',
|
|
54
98
|
'no-eval': 'error',
|
|
@@ -64,7 +108,13 @@ export default {
|
|
|
64
108
|
'no-invalid-regexp': 'error',
|
|
65
109
|
'no-irregular-whitespace': 'error',
|
|
66
110
|
'no-iterator': 'error',
|
|
67
|
-
'no-labels': [
|
|
111
|
+
'no-labels': [
|
|
112
|
+
'error',
|
|
113
|
+
{
|
|
114
|
+
allowLoop: false,
|
|
115
|
+
allowSwitch: false
|
|
116
|
+
}
|
|
117
|
+
],
|
|
68
118
|
'no-lone-blocks': 'error',
|
|
69
119
|
'no-loss-of-precision': 'error',
|
|
70
120
|
'no-misleading-character-class': 'error',
|
|
@@ -80,10 +130,23 @@ export default {
|
|
|
80
130
|
'no-octal': 'error',
|
|
81
131
|
'no-octal-escape': 'error',
|
|
82
132
|
'no-proto': 'error',
|
|
83
|
-
'no-redeclare': [
|
|
133
|
+
'no-redeclare': [
|
|
134
|
+
'error',
|
|
135
|
+
{
|
|
136
|
+
builtinGlobals: false
|
|
137
|
+
}
|
|
138
|
+
],
|
|
84
139
|
'no-regex-spaces': 'error',
|
|
85
|
-
'no-return-assign': [
|
|
86
|
-
|
|
140
|
+
'no-return-assign': [
|
|
141
|
+
'error',
|
|
142
|
+
'except-parens'
|
|
143
|
+
],
|
|
144
|
+
'no-self-assign': [
|
|
145
|
+
'error',
|
|
146
|
+
{
|
|
147
|
+
props: true
|
|
148
|
+
}
|
|
149
|
+
],
|
|
87
150
|
'no-self-compare': 'error',
|
|
88
151
|
'no-sequences': 'error',
|
|
89
152
|
'no-shadow-restricted-names': 'error',
|
|
@@ -95,23 +158,41 @@ export default {
|
|
|
95
158
|
'no-undef-init': 'error',
|
|
96
159
|
'no-unexpected-multiline': 'error',
|
|
97
160
|
'no-unmodified-loop-condition': 'error',
|
|
98
|
-
'no-unneeded-ternary': [
|
|
161
|
+
'no-unneeded-ternary': [
|
|
162
|
+
'error',
|
|
163
|
+
{
|
|
164
|
+
defaultAssignment: false
|
|
165
|
+
}
|
|
166
|
+
],
|
|
99
167
|
'no-unreachable': 'error',
|
|
100
168
|
'no-unreachable-loop': 'error',
|
|
101
169
|
'no-unsafe-finally': 'error',
|
|
102
170
|
'no-unsafe-negation': 'error',
|
|
103
|
-
'no-unused-expressions': [
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
171
|
+
'no-unused-expressions': [
|
|
172
|
+
'error',
|
|
173
|
+
{
|
|
174
|
+
allowShortCircuit: true,
|
|
175
|
+
allowTernary: true,
|
|
176
|
+
allowTaggedTemplates: true
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
'no-unused-vars': [
|
|
180
|
+
'error',
|
|
181
|
+
{
|
|
182
|
+
args: 'none',
|
|
183
|
+
caughtErrors: 'none',
|
|
184
|
+
ignoreRestSiblings: true,
|
|
185
|
+
vars: 'all'
|
|
186
|
+
}
|
|
187
|
+
],
|
|
188
|
+
'no-use-before-define': [
|
|
189
|
+
'error',
|
|
190
|
+
{
|
|
191
|
+
functions: false,
|
|
192
|
+
classes: false,
|
|
193
|
+
variables: false
|
|
194
|
+
}
|
|
195
|
+
],
|
|
115
196
|
'no-useless-call': 'error',
|
|
116
197
|
'no-useless-computed-key': 'error',
|
|
117
198
|
'no-useless-constructor': 'error',
|
|
@@ -120,23 +201,55 @@ export default {
|
|
|
120
201
|
'no-useless-return': 'error',
|
|
121
202
|
'no-void': 'error',
|
|
122
203
|
'no-with': 'error',
|
|
123
|
-
'one-var': [
|
|
124
|
-
|
|
204
|
+
'one-var': [
|
|
205
|
+
'error',
|
|
206
|
+
{
|
|
207
|
+
initialized: 'never'
|
|
208
|
+
}
|
|
209
|
+
],
|
|
210
|
+
'prefer-const': [
|
|
211
|
+
'error',
|
|
212
|
+
{
|
|
213
|
+
destructuring: 'all'
|
|
214
|
+
}
|
|
215
|
+
],
|
|
125
216
|
'prefer-promise-reject-errors': 'error',
|
|
126
|
-
'prefer-regex-literals': [
|
|
217
|
+
'prefer-regex-literals': [
|
|
218
|
+
'error',
|
|
219
|
+
{
|
|
220
|
+
disallowRedundantWrapping: true
|
|
221
|
+
}
|
|
222
|
+
],
|
|
127
223
|
'symbol-description': 'error',
|
|
128
|
-
'unicode-bom': [
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
224
|
+
'unicode-bom': [
|
|
225
|
+
'error',
|
|
226
|
+
'never'
|
|
227
|
+
],
|
|
228
|
+
'use-isnan': [
|
|
229
|
+
'error',
|
|
230
|
+
{
|
|
231
|
+
enforceForSwitchCase: true,
|
|
232
|
+
enforceForIndexOf: true
|
|
233
|
+
}
|
|
234
|
+
],
|
|
235
|
+
'valid-typeof': [
|
|
236
|
+
'error',
|
|
237
|
+
{
|
|
238
|
+
requireStringLiterals: true
|
|
239
|
+
}
|
|
240
|
+
],
|
|
241
|
+
yoda: [
|
|
242
|
+
'error',
|
|
243
|
+
'never'
|
|
244
|
+
],
|
|
135
245
|
|
|
136
246
|
/**
|
|
137
247
|
* `eslint-plugin-n`
|
|
138
248
|
*/
|
|
139
|
-
'n/handle-callback-err': [
|
|
249
|
+
'n/handle-callback-err': [
|
|
250
|
+
'error',
|
|
251
|
+
'^(err|error)$'
|
|
252
|
+
],
|
|
140
253
|
'n/no-callback-literal': 'error',
|
|
141
254
|
'n/no-deprecated-api': 'error',
|
|
142
255
|
'n/no-exports-assign': 'error',
|
|
@@ -154,7 +267,14 @@ export default {
|
|
|
154
267
|
*/
|
|
155
268
|
'import/export': 'error',
|
|
156
269
|
'import/first': 'error',
|
|
157
|
-
'import/no-absolute-path': [
|
|
270
|
+
'import/no-absolute-path': [
|
|
271
|
+
'error',
|
|
272
|
+
{
|
|
273
|
+
esmodule: true,
|
|
274
|
+
commonjs: true,
|
|
275
|
+
amd: false
|
|
276
|
+
}
|
|
277
|
+
],
|
|
158
278
|
'import/no-duplicates': 'error',
|
|
159
279
|
'import/no-named-default': 'error',
|
|
160
280
|
'import/no-webpack-loader-syntax': 'error'
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import stylistic from '@stylistic/eslint-plugin'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
name: '@sequencemedia/eslint-config-standard/stylistic',
|
|
5
|
+
plugins: {
|
|
6
|
+
'@stylistic': stylistic
|
|
7
|
+
|
|
8
|
+
},
|
|
9
|
+
rules: {
|
|
10
|
+
/**
|
|
11
|
+
* `@stylistic/eslint-plugin`
|
|
12
|
+
*/
|
|
13
|
+
'@stylistic/array-bracket-spacing': [
|
|
14
|
+
'error',
|
|
15
|
+
'never'
|
|
16
|
+
],
|
|
17
|
+
'@stylistic/arrow-spacing': [
|
|
18
|
+
'error',
|
|
19
|
+
{
|
|
20
|
+
before: true,
|
|
21
|
+
after: true
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
'@stylistic/block-spacing': [
|
|
25
|
+
'error',
|
|
26
|
+
'always'
|
|
27
|
+
],
|
|
28
|
+
'@stylistic/brace-style': [
|
|
29
|
+
'error',
|
|
30
|
+
'1tbs',
|
|
31
|
+
{
|
|
32
|
+
allowSingleLine: true
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
'@stylistic/comma-dangle': [
|
|
36
|
+
'error',
|
|
37
|
+
{
|
|
38
|
+
arrays: 'never',
|
|
39
|
+
objects: 'never',
|
|
40
|
+
imports: 'never',
|
|
41
|
+
exports: 'never',
|
|
42
|
+
functions: 'never'
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
'@stylistic/comma-spacing': [
|
|
46
|
+
'error',
|
|
47
|
+
{
|
|
48
|
+
before: false,
|
|
49
|
+
after: true
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
'@stylistic/comma-style': [
|
|
53
|
+
'error',
|
|
54
|
+
'last'
|
|
55
|
+
],
|
|
56
|
+
'@stylistic/computed-property-spacing': [
|
|
57
|
+
'error',
|
|
58
|
+
'never',
|
|
59
|
+
{
|
|
60
|
+
enforceForClassMembers: true
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
'@stylistic/dot-location': [
|
|
64
|
+
'error',
|
|
65
|
+
'property'
|
|
66
|
+
],
|
|
67
|
+
'@stylistic/eol-last': 'error',
|
|
68
|
+
'@stylistic/func-call-spacing': [
|
|
69
|
+
'error',
|
|
70
|
+
'never'
|
|
71
|
+
],
|
|
72
|
+
'@stylistic/generator-star-spacing': [
|
|
73
|
+
'error',
|
|
74
|
+
{
|
|
75
|
+
before: true,
|
|
76
|
+
after: true
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
'@stylistic/indent': [
|
|
80
|
+
'error',
|
|
81
|
+
2,
|
|
82
|
+
{
|
|
83
|
+
SwitchCase: 1,
|
|
84
|
+
VariableDeclarator: 1,
|
|
85
|
+
outerIIFEBody: 1,
|
|
86
|
+
MemberExpression: 1,
|
|
87
|
+
FunctionDeclaration: {
|
|
88
|
+
parameters: 1,
|
|
89
|
+
body: 1
|
|
90
|
+
},
|
|
91
|
+
FunctionExpression: {
|
|
92
|
+
parameters: 1,
|
|
93
|
+
body: 1
|
|
94
|
+
},
|
|
95
|
+
CallExpression: {
|
|
96
|
+
arguments: 1
|
|
97
|
+
},
|
|
98
|
+
ArrayExpression: 1,
|
|
99
|
+
ObjectExpression: 1,
|
|
100
|
+
ImportDeclaration: 1,
|
|
101
|
+
flatTernaryExpressions: false,
|
|
102
|
+
ignoreComments: false,
|
|
103
|
+
ignoredNodes: [
|
|
104
|
+
'TemplateLiteral *',
|
|
105
|
+
'JSXElement',
|
|
106
|
+
'JSXElement > *',
|
|
107
|
+
'JSXAttribute',
|
|
108
|
+
'JSXIdentifier',
|
|
109
|
+
'JSXNamespacedName',
|
|
110
|
+
'JSXMemberExpression',
|
|
111
|
+
'JSXSpreadAttribute',
|
|
112
|
+
'JSXExpressionContainer',
|
|
113
|
+
'JSXOpeningElement',
|
|
114
|
+
'JSXClosingElement',
|
|
115
|
+
'JSXFragment',
|
|
116
|
+
'JSXOpeningFragment',
|
|
117
|
+
'JSXClosingFragment',
|
|
118
|
+
'JSXText',
|
|
119
|
+
'JSXEmptyExpression',
|
|
120
|
+
'JSXSpreadChild'
|
|
121
|
+
],
|
|
122
|
+
offsetTernaryExpressions: true
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
'@stylistic/key-spacing': [
|
|
126
|
+
'error',
|
|
127
|
+
{
|
|
128
|
+
beforeColon: false,
|
|
129
|
+
afterColon: true
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
'@stylistic/keyword-spacing': [
|
|
133
|
+
'error',
|
|
134
|
+
{
|
|
135
|
+
before: true,
|
|
136
|
+
after: true
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
'@stylistic/lines-between-class-members': [
|
|
140
|
+
'error',
|
|
141
|
+
'always',
|
|
142
|
+
{
|
|
143
|
+
exceptAfterSingleLine: true
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
'@stylistic/multiline-ternary': [
|
|
147
|
+
'error',
|
|
148
|
+
'always-multiline'
|
|
149
|
+
],
|
|
150
|
+
'@stylistic/new-parens': 'error',
|
|
151
|
+
'@stylistic/no-extra-parens': [
|
|
152
|
+
'error',
|
|
153
|
+
'functions'
|
|
154
|
+
],
|
|
155
|
+
'@stylistic/no-floating-decimal': 'error',
|
|
156
|
+
'@stylistic/no-mixed-operators': [
|
|
157
|
+
'error',
|
|
158
|
+
{
|
|
159
|
+
groups: [
|
|
160
|
+
[
|
|
161
|
+
'==',
|
|
162
|
+
'!=',
|
|
163
|
+
'===',
|
|
164
|
+
'!==',
|
|
165
|
+
'>',
|
|
166
|
+
'>=',
|
|
167
|
+
'<',
|
|
168
|
+
'<='
|
|
169
|
+
],
|
|
170
|
+
[
|
|
171
|
+
'&&',
|
|
172
|
+
'||'
|
|
173
|
+
],
|
|
174
|
+
[
|
|
175
|
+
'in',
|
|
176
|
+
'instanceof'
|
|
177
|
+
]
|
|
178
|
+
],
|
|
179
|
+
allowSamePrecedence: true
|
|
180
|
+
}
|
|
181
|
+
],
|
|
182
|
+
'@stylistic/no-mixed-spaces-and-tabs': 'error',
|
|
183
|
+
'@stylistic/no-multi-spaces': 'error',
|
|
184
|
+
'@stylistic/no-multiple-empty-lines': [
|
|
185
|
+
'error',
|
|
186
|
+
{
|
|
187
|
+
max: 1,
|
|
188
|
+
maxBOF: 0,
|
|
189
|
+
maxEOF: 0
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
'@stylistic/no-tabs': 'error',
|
|
193
|
+
'@stylistic/no-trailing-spaces': 'error',
|
|
194
|
+
'@stylistic/no-whitespace-before-property': 'error',
|
|
195
|
+
'@stylistic/object-curly-newline': [
|
|
196
|
+
'error',
|
|
197
|
+
{
|
|
198
|
+
multiline: true,
|
|
199
|
+
consistent: true
|
|
200
|
+
}
|
|
201
|
+
],
|
|
202
|
+
'@stylistic/object-curly-spacing': [
|
|
203
|
+
'error',
|
|
204
|
+
'always'
|
|
205
|
+
],
|
|
206
|
+
'@stylistic/object-property-newline': [
|
|
207
|
+
'error',
|
|
208
|
+
{
|
|
209
|
+
allowMultiplePropertiesPerLine: true
|
|
210
|
+
}
|
|
211
|
+
],
|
|
212
|
+
'@stylistic/operator-linebreak': [
|
|
213
|
+
'error',
|
|
214
|
+
'after',
|
|
215
|
+
{
|
|
216
|
+
overrides: {
|
|
217
|
+
'?': 'before',
|
|
218
|
+
':': 'before',
|
|
219
|
+
'|>': 'before'
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
],
|
|
223
|
+
'@stylistic/padded-blocks': [
|
|
224
|
+
'error',
|
|
225
|
+
{
|
|
226
|
+
blocks: 'never',
|
|
227
|
+
switches: 'never',
|
|
228
|
+
classes: 'never'
|
|
229
|
+
}
|
|
230
|
+
],
|
|
231
|
+
'@stylistic/quote-props': [
|
|
232
|
+
'error',
|
|
233
|
+
'as-needed'
|
|
234
|
+
],
|
|
235
|
+
'@stylistic/quotes': [
|
|
236
|
+
'error',
|
|
237
|
+
'single',
|
|
238
|
+
{
|
|
239
|
+
avoidEscape: true,
|
|
240
|
+
allowTemplateLiterals: false
|
|
241
|
+
}
|
|
242
|
+
],
|
|
243
|
+
'@stylistic/rest-spread-spacing': [
|
|
244
|
+
'error',
|
|
245
|
+
'never'
|
|
246
|
+
],
|
|
247
|
+
'@stylistic/semi': [
|
|
248
|
+
'error',
|
|
249
|
+
'never'
|
|
250
|
+
],
|
|
251
|
+
'@stylistic/semi-spacing': [
|
|
252
|
+
'error',
|
|
253
|
+
{
|
|
254
|
+
before: false,
|
|
255
|
+
after: true
|
|
256
|
+
}
|
|
257
|
+
],
|
|
258
|
+
'@stylistic/space-before-blocks': [
|
|
259
|
+
'error',
|
|
260
|
+
'always'
|
|
261
|
+
],
|
|
262
|
+
'@stylistic/space-before-function-paren': [
|
|
263
|
+
'error',
|
|
264
|
+
'always'
|
|
265
|
+
],
|
|
266
|
+
'@stylistic/space-in-parens': [
|
|
267
|
+
'error',
|
|
268
|
+
'never'
|
|
269
|
+
],
|
|
270
|
+
'@stylistic/space-infix-ops': 'error',
|
|
271
|
+
'@stylistic/space-unary-ops': [
|
|
272
|
+
'error',
|
|
273
|
+
{
|
|
274
|
+
words: true,
|
|
275
|
+
nonwords: false
|
|
276
|
+
}
|
|
277
|
+
],
|
|
278
|
+
'@stylistic/spaced-comment': [
|
|
279
|
+
'error',
|
|
280
|
+
'always',
|
|
281
|
+
{
|
|
282
|
+
line: {
|
|
283
|
+
markers: [
|
|
284
|
+
'*package',
|
|
285
|
+
'!',
|
|
286
|
+
'/',
|
|
287
|
+
',',
|
|
288
|
+
'='
|
|
289
|
+
]
|
|
290
|
+
},
|
|
291
|
+
block: {
|
|
292
|
+
balanced: true,
|
|
293
|
+
markers: [
|
|
294
|
+
'*package',
|
|
295
|
+
'!',
|
|
296
|
+
',',
|
|
297
|
+
':',
|
|
298
|
+
'::',
|
|
299
|
+
'flow-include'
|
|
300
|
+
],
|
|
301
|
+
exceptions: [
|
|
302
|
+
'*'
|
|
303
|
+
]
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
],
|
|
307
|
+
'@stylistic/template-curly-spacing': [
|
|
308
|
+
'error',
|
|
309
|
+
'never'
|
|
310
|
+
],
|
|
311
|
+
'@stylistic/template-tag-spacing': [
|
|
312
|
+
'error',
|
|
313
|
+
'never'
|
|
314
|
+
],
|
|
315
|
+
'@stylistic/wrap-iife': [
|
|
316
|
+
'error',
|
|
317
|
+
'any',
|
|
318
|
+
{
|
|
319
|
+
functionPrototypeMethods: true
|
|
320
|
+
}
|
|
321
|
+
],
|
|
322
|
+
'@stylistic/yield-star-spacing': [
|
|
323
|
+
'error',
|
|
324
|
+
'both'
|
|
325
|
+
]
|
|
326
|
+
}
|
|
327
|
+
}
|
package/index.mjs
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import recommended from '#eslint-config-standard/configs/recommended'
|
|
2
|
+
import standard from '#eslint-config-standard/configs/standard'
|
|
3
|
+
import stylistic from '#eslint-config-standard/configs/stylistic'
|
|
4
|
+
|
|
5
|
+
export const configs = {
|
|
6
|
+
recommended,
|
|
7
|
+
standard,
|
|
8
|
+
stylistic
|
|
9
|
+
}
|
|
3
10
|
|
|
4
11
|
export default [
|
|
5
12
|
{
|
|
6
13
|
name: '@sequencemedia/eslint-config-standard',
|
|
7
14
|
languageOptions: {
|
|
8
15
|
ecmaVersion: 'latest'
|
|
9
|
-
}
|
|
16
|
+
},
|
|
17
|
+
files: [
|
|
18
|
+
'**/*.{js,mjs,cjs}'
|
|
19
|
+
]
|
|
10
20
|
},
|
|
11
21
|
standard,
|
|
12
22
|
stylistic
|
package/merge/standard.mjs
CHANGED
package/merge/stylistic.mjs
CHANGED
package/merge.mjs
CHANGED
|
@@ -2,9 +2,22 @@ import getMapMerge from '@sequencemedia/eslint-merge/get-map-merge'
|
|
|
2
2
|
|
|
3
3
|
import eslintConfig from './index.mjs'
|
|
4
4
|
|
|
5
|
+
function include ({ name }) {
|
|
6
|
+
return name === '@sequencemedia/eslint-config-standard'
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function exclude ({ name }) {
|
|
10
|
+
return name !== '@sequencemedia/eslint-config-standard'
|
|
11
|
+
}
|
|
12
|
+
|
|
5
13
|
export default function mergeESLintConfigWith (config) {
|
|
6
14
|
return (
|
|
7
15
|
eslintConfig
|
|
8
|
-
.
|
|
16
|
+
.filter(include)
|
|
17
|
+
.concat(
|
|
18
|
+
eslintConfig
|
|
19
|
+
.filter(exclude)
|
|
20
|
+
.map(getMapMerge(config))
|
|
21
|
+
)
|
|
9
22
|
)
|
|
10
23
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sequencemedia/eslint-config-standard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Standard configuration for ESLint 9",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"JavaScript Standard Style",
|
|
@@ -70,14 +70,15 @@
|
|
|
70
70
|
"imports": {
|
|
71
71
|
"#eslint-config-standard": "./index.mjs",
|
|
72
72
|
"#eslint-config-standard/common": "./common/index.mjs",
|
|
73
|
-
"#eslint-config-standard/
|
|
73
|
+
"#eslint-config-standard/configs": "./configs/index.mjs",
|
|
74
|
+
"#eslint-config-standard/configs/*": "./configs/*.mjs",
|
|
74
75
|
"#eslint-config-standard/merge": "./merge.mjs",
|
|
75
76
|
"#eslint-config-standard/merge/*": "./merge/*.mjs"
|
|
76
77
|
},
|
|
77
78
|
"exports": {
|
|
78
79
|
".": "./index.mjs",
|
|
79
|
-
"./
|
|
80
|
-
"./
|
|
80
|
+
"./configs": "./configs/index.mjs",
|
|
81
|
+
"./configs/*": "./configs/*.mjs",
|
|
81
82
|
"./merge": "./merge.mjs",
|
|
82
83
|
"./merge/*": "./merge/*.mjs"
|
|
83
84
|
}
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
isString,
|
|
7
7
|
isObject
|
|
8
|
-
} from '
|
|
8
|
+
} from '#eslint-config-standard/common'
|
|
9
9
|
|
|
10
|
-
describe('
|
|
10
|
+
describe('#eslint-config-standard/common', () => {
|
|
11
11
|
describe('`isString`', () => it('is a function', () => expect(isString).to.be.a('function')))
|
|
12
12
|
|
|
13
13
|
describe('`isObject`', () => it('is a function', () => expect(isObject).to.be.a('function')))
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
expect
|
|
3
|
+
} from 'chai'
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
recommended,
|
|
7
|
+
standard,
|
|
8
|
+
stylistic
|
|
9
|
+
} from '@sequencemedia/eslint-config-standard/configs'
|
|
10
|
+
|
|
11
|
+
describe('@sequencemedia/eslint-config-standard/configs', () => {
|
|
12
|
+
describe('`recommended`', () => it('is an object', () => expect(recommended).to.be.an('object')))
|
|
13
|
+
|
|
14
|
+
describe('`standard`', () => it('is an object', () => expect(standard).to.be.an('object')))
|
|
15
|
+
|
|
16
|
+
describe('`stylistic`', () => it('is an object', () => expect(stylistic).to.be.an('object')))
|
|
17
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
expect
|
|
3
|
+
} from 'chai'
|
|
4
|
+
|
|
5
|
+
import recommended from '@sequencemedia/eslint-config-standard/configs/recommended'
|
|
6
|
+
|
|
7
|
+
describe('@sequencemedia/eslint-config-standard/configs/recommended', () => {
|
|
8
|
+
describe('`recommended`', () => it('is an object', () => expect(recommended).to.be.an('object')))
|
|
9
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
expect
|
|
3
|
+
} from 'chai'
|
|
4
|
+
|
|
5
|
+
import standard from '@sequencemedia/eslint-config-standard/configs/standard'
|
|
6
|
+
|
|
7
|
+
describe('@sequencemedia/eslint-config-standard/configs/standard', () => {
|
|
8
|
+
describe('`standard`', () => it('is an object', () => expect(standard).to.be.an('object')))
|
|
9
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
expect
|
|
3
|
+
} from 'chai'
|
|
4
|
+
|
|
5
|
+
import stylistic from '@sequencemedia/eslint-config-standard/configs/stylistic'
|
|
6
|
+
|
|
7
|
+
describe('@sequencemedia/eslint-config-standard/configs/stylistic', () => {
|
|
8
|
+
describe('`stylistic`', () => it('is an object', () => expect(stylistic).to.be.an('object')))
|
|
9
|
+
})
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import {
|
|
2
|
+
expect
|
|
3
|
+
} from 'chai'
|
|
4
|
+
|
|
5
|
+
import RECOMMENDED from '@sequencemedia/eslint-config-standard/configs/recommended'
|
|
6
|
+
|
|
7
|
+
import merge from '@sequencemedia/eslint-config-standard/merge/recommended'
|
|
8
|
+
|
|
9
|
+
describe('@sequencemedia/eslint-config-standard/merge/recommended', () => {
|
|
10
|
+
describe('`merge`', () => it('is a function', () => expect(merge).to.be.a('function')))
|
|
11
|
+
|
|
12
|
+
describe('`merge()`', () => {
|
|
13
|
+
describe('Always', () => it('returns an object', () => expect(merge()).to.be.an('object')))
|
|
14
|
+
|
|
15
|
+
describe('Merges', () => {
|
|
16
|
+
it('returns an object', () => {
|
|
17
|
+
const MOCK_FILES = [
|
|
18
|
+
'MOCK FILES'
|
|
19
|
+
]
|
|
20
|
+
const MOCK_IGNORES = [
|
|
21
|
+
'MOCK IGNORES'
|
|
22
|
+
]
|
|
23
|
+
const MOCK_LANGUAGE_OPTIONS = { mockOption: 'MOCK LANGUAGE OPTIONS' }
|
|
24
|
+
const MOCK_LINTER_OPTIONS = { mockOption: 'MOCK LINTER OPTIONS' }
|
|
25
|
+
const MOCK_RULES = { mockOption: 'MOCK RULES' }
|
|
26
|
+
const MOCK_SETTINGS = { mockOption: 'MOCK SETTINGS' }
|
|
27
|
+
|
|
28
|
+
const {
|
|
29
|
+
languageOptions: RECOMMENDED_LANGUAGE_OPTIONS,
|
|
30
|
+
rules: RECOMMENDED_RULES
|
|
31
|
+
} = RECOMMENDED
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
expect(
|
|
35
|
+
merge({
|
|
36
|
+
files: MOCK_FILES,
|
|
37
|
+
ignores: MOCK_IGNORES,
|
|
38
|
+
languageOptions: MOCK_LANGUAGE_OPTIONS,
|
|
39
|
+
linterOptions: MOCK_LINTER_OPTIONS,
|
|
40
|
+
rules: MOCK_RULES,
|
|
41
|
+
settings: MOCK_SETTINGS
|
|
42
|
+
})
|
|
43
|
+
)
|
|
44
|
+
.to.eql({
|
|
45
|
+
...RECOMMENDED,
|
|
46
|
+
files: MOCK_FILES,
|
|
47
|
+
ignores: MOCK_IGNORES,
|
|
48
|
+
languageOptions: {
|
|
49
|
+
...RECOMMENDED_LANGUAGE_OPTIONS,
|
|
50
|
+
...MOCK_LANGUAGE_OPTIONS
|
|
51
|
+
},
|
|
52
|
+
linterOptions: MOCK_LINTER_OPTIONS,
|
|
53
|
+
rules: {
|
|
54
|
+
...RECOMMENDED_RULES,
|
|
55
|
+
...MOCK_RULES
|
|
56
|
+
},
|
|
57
|
+
settings: MOCK_SETTINGS
|
|
58
|
+
})
|
|
59
|
+
)
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
})
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
expect
|
|
3
3
|
} from 'chai'
|
|
4
4
|
|
|
5
|
-
import STANDARD from '@sequencemedia/eslint-config-standard/
|
|
5
|
+
import STANDARD from '@sequencemedia/eslint-config-standard/configs/standard'
|
|
6
6
|
|
|
7
7
|
import merge from '@sequencemedia/eslint-config-standard/merge/standard'
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
expect
|
|
3
3
|
} from 'chai'
|
|
4
4
|
|
|
5
|
-
import STYLISTIC from '@sequencemedia/eslint-config-standard/
|
|
5
|
+
import STYLISTIC from '@sequencemedia/eslint-config-standard/configs/stylistic'
|
|
6
6
|
|
|
7
7
|
import merge from '@sequencemedia/eslint-config-standard/merge/stylistic'
|
|
8
8
|
|
package/test/merge.spec.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
expect
|
|
3
3
|
} from 'chai'
|
|
4
4
|
|
|
5
|
-
import STANDARD from '@sequencemedia/eslint-config-standard/
|
|
6
|
-
import STYLISTIC from '@sequencemedia/eslint-config-standard/
|
|
5
|
+
import STANDARD from '@sequencemedia/eslint-config-standard/configs/standard'
|
|
6
|
+
import STYLISTIC from '@sequencemedia/eslint-config-standard/configs/stylistic'
|
|
7
7
|
|
|
8
8
|
import merge from '@sequencemedia/eslint-config-standard/merge'
|
|
9
9
|
|
|
@@ -21,10 +21,18 @@ describe('@sequencemedia/eslint-config-standard/merge', () => {
|
|
|
21
21
|
const MOCK_IGNORES = [
|
|
22
22
|
'MOCK IGNORES'
|
|
23
23
|
]
|
|
24
|
-
const MOCK_LANGUAGE_OPTIONS = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
24
|
+
const MOCK_LANGUAGE_OPTIONS = {
|
|
25
|
+
mockOption: 'MOCK LANGUAGE OPTIONS'
|
|
26
|
+
}
|
|
27
|
+
const MOCK_LINTER_OPTIONS = {
|
|
28
|
+
mockOption: 'MOCK LINTER OPTIONS'
|
|
29
|
+
}
|
|
30
|
+
const MOCK_RULES = {
|
|
31
|
+
mockOption: 'MOCK RULES'
|
|
32
|
+
}
|
|
33
|
+
const MOCK_SETTINGS = {
|
|
34
|
+
mockOption: 'MOCK SETTINGS'
|
|
35
|
+
}
|
|
28
36
|
|
|
29
37
|
const {
|
|
30
38
|
rules: STANDARD_RULES
|
|
@@ -48,15 +56,12 @@ describe('@sequencemedia/eslint-config-standard/merge', () => {
|
|
|
48
56
|
.to.eql([
|
|
49
57
|
{
|
|
50
58
|
name: '@sequencemedia/eslint-config-standard',
|
|
51
|
-
files: MOCK_FILES,
|
|
52
|
-
ignores: MOCK_IGNORES,
|
|
53
59
|
languageOptions: {
|
|
54
|
-
ecmaVersion: 'latest'
|
|
55
|
-
...MOCK_LANGUAGE_OPTIONS
|
|
60
|
+
ecmaVersion: 'latest'
|
|
56
61
|
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
62
|
+
files: [
|
|
63
|
+
'**/*.{js,mjs,cjs}'
|
|
64
|
+
]
|
|
60
65
|
},
|
|
61
66
|
{
|
|
62
67
|
...STANDARD,
|
package/common/merge.mjs
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
function hasLanguageOptionsParser ({ languageOptions: { parser = null } = {} }) {
|
|
2
|
-
return Boolean(parser)
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
function getLanguageOptionsParser ({ languageOptions: { parser = null } = {} }) {
|
|
6
|
-
return parser
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function removeParserByEntriesKey ([key]) {
|
|
10
|
-
return key !== 'parser'
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function getLanguageOptionsWithoutParser ({ languageOptions = {} }) {
|
|
14
|
-
const entries = Object.entries(languageOptions)
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
Object.fromEntries(
|
|
18
|
-
entries.filter(removeParserByEntriesKey)
|
|
19
|
-
)
|
|
20
|
-
)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function getLanguageOptions ({ languageOptions = {} }) {
|
|
24
|
-
return languageOptions
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function getLinterOptions ({ linterOptions = {} }) {
|
|
28
|
-
return linterOptions
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function getProcessor ({ processor = {} }) {
|
|
32
|
-
return processor
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function getRules ({ rules = {} }) {
|
|
36
|
-
return rules
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function getSettings ({ settings = {} }) {
|
|
40
|
-
return settings
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function mergeLanguageOptions (alpha = {}, omega = {}) {
|
|
44
|
-
return (
|
|
45
|
-
Object
|
|
46
|
-
.assign(
|
|
47
|
-
hasLanguageOptionsParser(alpha) ? { parser: getLanguageOptionsParser(alpha) } : {},
|
|
48
|
-
structuredClone(getLanguageOptionsWithoutParser(alpha)),
|
|
49
|
-
getLanguageOptions(omega)
|
|
50
|
-
)
|
|
51
|
-
)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export function mergeLinterOptions (alpha = {}, omega = {}) {
|
|
55
|
-
return (
|
|
56
|
-
Object
|
|
57
|
-
.assign(
|
|
58
|
-
structuredClone(getLinterOptions(alpha)),
|
|
59
|
-
getLinterOptions(omega)
|
|
60
|
-
)
|
|
61
|
-
)
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export function mergeRules (alpha = {}, omega = {}) {
|
|
65
|
-
return (
|
|
66
|
-
Object
|
|
67
|
-
.assign(
|
|
68
|
-
structuredClone(getRules(alpha)),
|
|
69
|
-
getRules(omega)
|
|
70
|
-
)
|
|
71
|
-
)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export function mergeSettings (alpha = {}, omega = {}) {
|
|
75
|
-
return (
|
|
76
|
-
Object
|
|
77
|
-
.assign(
|
|
78
|
-
structuredClone(getSettings(alpha)),
|
|
79
|
-
getSettings(omega)
|
|
80
|
-
)
|
|
81
|
-
)
|
|
82
|
-
}
|
package/config/stylistic.mjs
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import stylistic from '@stylistic/eslint-plugin'
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
name: '@sequencemedia/eslint-config-standard/stylistic',
|
|
5
|
-
plugins: {
|
|
6
|
-
'@stylistic': stylistic
|
|
7
|
-
},
|
|
8
|
-
rules: {
|
|
9
|
-
/**
|
|
10
|
-
* `@stylistic/eslint-plugin`
|
|
11
|
-
*/
|
|
12
|
-
'@stylistic/array-bracket-spacing': ['error', 'never'],
|
|
13
|
-
'@stylistic/arrow-spacing': ['error', { before: true, after: true }],
|
|
14
|
-
'@stylistic/block-spacing': ['error', 'always'],
|
|
15
|
-
'@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }],
|
|
16
|
-
'@stylistic/comma-dangle': ['error', {
|
|
17
|
-
arrays: 'never',
|
|
18
|
-
objects: 'never',
|
|
19
|
-
imports: 'never',
|
|
20
|
-
exports: 'never',
|
|
21
|
-
functions: 'never'
|
|
22
|
-
}],
|
|
23
|
-
'@stylistic/comma-spacing': ['error', { before: false, after: true }],
|
|
24
|
-
'@stylistic/comma-style': ['error', 'last'],
|
|
25
|
-
'@stylistic/computed-property-spacing': ['error', 'never', { enforceForClassMembers: true }],
|
|
26
|
-
'@stylistic/dot-location': ['error', 'property'],
|
|
27
|
-
'@stylistic/eol-last': 'error',
|
|
28
|
-
'@stylistic/func-call-spacing': ['error', 'never'],
|
|
29
|
-
'@stylistic/generator-star-spacing': ['error', { before: true, after: true }],
|
|
30
|
-
'@stylistic/indent': ['error', 2, {
|
|
31
|
-
SwitchCase: 1,
|
|
32
|
-
VariableDeclarator: 1,
|
|
33
|
-
outerIIFEBody: 1,
|
|
34
|
-
MemberExpression: 1,
|
|
35
|
-
FunctionDeclaration: { parameters: 1, body: 1 },
|
|
36
|
-
FunctionExpression: { parameters: 1, body: 1 },
|
|
37
|
-
CallExpression: { arguments: 1 },
|
|
38
|
-
ArrayExpression: 1,
|
|
39
|
-
ObjectExpression: 1,
|
|
40
|
-
ImportDeclaration: 1,
|
|
41
|
-
flatTernaryExpressions: false,
|
|
42
|
-
ignoreComments: false,
|
|
43
|
-
ignoredNodes: ['TemplateLiteral *', 'JSXElement', 'JSXElement > *', 'JSXAttribute', 'JSXIdentifier', 'JSXNamespacedName', 'JSXMemberExpression', 'JSXSpreadAttribute', 'JSXExpressionContainer', 'JSXOpeningElement', 'JSXClosingElement', 'JSXFragment', 'JSXOpeningFragment', 'JSXClosingFragment', 'JSXText', 'JSXEmptyExpression', 'JSXSpreadChild'],
|
|
44
|
-
offsetTernaryExpressions: true
|
|
45
|
-
}],
|
|
46
|
-
'@stylistic/key-spacing': ['error', { beforeColon: false, afterColon: true }],
|
|
47
|
-
'@stylistic/keyword-spacing': ['error', { before: true, after: true }],
|
|
48
|
-
'@stylistic/lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
|
|
49
|
-
'@stylistic/multiline-ternary': ['error', 'always-multiline'],
|
|
50
|
-
'@stylistic/new-parens': 'error',
|
|
51
|
-
'@stylistic/no-extra-parens': ['error', 'functions'],
|
|
52
|
-
'@stylistic/no-floating-decimal': 'error',
|
|
53
|
-
'@stylistic/no-mixed-operators': ['error', {
|
|
54
|
-
groups: [
|
|
55
|
-
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
|
|
56
|
-
['&&', '||'],
|
|
57
|
-
['in', 'instanceof']
|
|
58
|
-
],
|
|
59
|
-
allowSamePrecedence: true
|
|
60
|
-
}],
|
|
61
|
-
'@stylistic/no-mixed-spaces-and-tabs': 'error',
|
|
62
|
-
'@stylistic/no-multi-spaces': 'error',
|
|
63
|
-
'@stylistic/no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],
|
|
64
|
-
'@stylistic/no-tabs': 'error',
|
|
65
|
-
'@stylistic/no-trailing-spaces': 'error',
|
|
66
|
-
'@stylistic/no-whitespace-before-property': 'error',
|
|
67
|
-
'@stylistic/object-curly-newline': ['error', { multiline: true, consistent: true }],
|
|
68
|
-
'@stylistic/object-curly-spacing': ['error', 'always'],
|
|
69
|
-
'@stylistic/object-property-newline': ['error', { allowMultiplePropertiesPerLine: true }],
|
|
70
|
-
'@stylistic/operator-linebreak': ['error', 'after', { overrides: { '?': 'before', ':': 'before', '|>': 'before' } }],
|
|
71
|
-
'@stylistic/padded-blocks': ['error', { blocks: 'never', switches: 'never', classes: 'never' }],
|
|
72
|
-
'@stylistic/quote-props': ['error', 'as-needed'],
|
|
73
|
-
'@stylistic/quotes': ['error', 'single', { avoidEscape: true, allowTemplateLiterals: false }],
|
|
74
|
-
'@stylistic/rest-spread-spacing': ['error', 'never'],
|
|
75
|
-
'@stylistic/semi': ['error', 'never'],
|
|
76
|
-
'@stylistic/semi-spacing': ['error', { before: false, after: true }],
|
|
77
|
-
'@stylistic/space-before-blocks': ['error', 'always'],
|
|
78
|
-
'@stylistic/space-before-function-paren': ['error', 'always'],
|
|
79
|
-
'@stylistic/space-in-parens': ['error', 'never'],
|
|
80
|
-
'@stylistic/space-infix-ops': 'error',
|
|
81
|
-
'@stylistic/space-unary-ops': ['error', { words: true, nonwords: false }],
|
|
82
|
-
'@stylistic/spaced-comment': ['error', 'always', {
|
|
83
|
-
line: { markers: ['*package', '!', '/', ',', '='] },
|
|
84
|
-
block: { balanced: true, markers: ['*package', '!', ',', ':', '::', 'flow-include'], exceptions: ['*'] }
|
|
85
|
-
}],
|
|
86
|
-
'@stylistic/template-curly-spacing': ['error', 'never'],
|
|
87
|
-
'@stylistic/template-tag-spacing': ['error', 'never'],
|
|
88
|
-
'@stylistic/wrap-iife': ['error', 'any', { functionPrototypeMethods: true }],
|
|
89
|
-
'@stylistic/yield-star-spacing': ['error', 'both']
|
|
90
|
-
}
|
|
91
|
-
}
|