@@ -19,6 +19,7 @@ const hacks = [
19
19
'eslint-plugin-markdown' ,
20
20
'@babel/eslint-parser' ,
21
21
'@babel/plugin-syntax-import-attributes' ,
22
+ '@stylistic/eslint-plugin-js' ,
22
23
] ;
23
24
Module . _findPath = ( request , paths , isMain ) => {
24
25
const r = ModuleFindPath ( request , paths , isMain ) ;
@@ -39,7 +40,7 @@ module.exports = {
39
40
es2022 : true ,
40
41
} ,
41
42
extends : [ 'eslint:recommended' , 'plugin:jsdoc/recommended' ] ,
42
- plugins : [ 'jsdoc' , 'markdown' , 'node-core' ] ,
43
+ plugins : [ 'jsdoc' , 'markdown' , 'node-core' , '@stylistic/js' ] ,
43
44
parser : '@babel/eslint-parser' ,
44
45
parserOptions : {
45
46
babelOptions : {
@@ -133,11 +134,7 @@ module.exports = {
133
134
// https://eslint.org/docs/rules/
134
135
'accessor-pairs' : 'error' ,
135
136
'array-callback-return' : 'error' ,
136
- 'arrow-parens' : 'error' ,
137
- 'arrow-spacing' : 'error' ,
138
137
'block-scoped-var' : 'error' ,
139
- 'block-spacing' : 'error' ,
140
- 'brace-style' : [ 'error' , '1tbs' , { allowSingleLine : true } ] ,
141
138
'capitalized-comments' : [ 'error' , 'always' , {
142
139
line : {
143
140
// Ignore all lines that have less characters than 20 and all lines that
@@ -150,49 +147,17 @@ module.exports = {
150
147
ignorePattern : '.*' ,
151
148
} ,
152
149
} ] ,
153
- 'comma-dangle' : [ 'error' , 'always-multiline' ] ,
154
- 'comma-spacing' : 'error' ,
155
- 'comma-style' : 'error' ,
156
- 'computed-property-spacing' : 'error' ,
157
150
'default-case-last' : 'error' ,
158
- 'dot-location' : [ 'error' , 'property' ] ,
159
151
'dot-notation' : 'error' ,
160
- 'eol-last' : 'error' ,
161
152
'eqeqeq' : [ 'error' , 'smart' ] ,
162
- 'func-call-spacing' : 'error' ,
163
153
'func-name-matching' : 'error' ,
164
154
'func-style' : [ 'error' , 'declaration' , { allowArrowFunctions : true } ] ,
165
- 'indent' : [ 'error' , 2 , {
166
- ArrayExpression : 'first' ,
167
- CallExpression : { arguments : 'first' } ,
168
- FunctionDeclaration : { parameters : 'first' } ,
169
- FunctionExpression : { parameters : 'first' } ,
170
- MemberExpression : 'off' ,
171
- ObjectExpression : 'first' ,
172
- SwitchCase : 1 ,
173
- } ] ,
174
- 'key-spacing' : 'error' ,
175
- 'keyword-spacing' : 'error' ,
176
- 'linebreak-style' : 'error' ,
177
- 'max-len' : [ 'error' , {
178
- code : 120 ,
179
- ignorePattern : '^// Flags:' ,
180
- ignoreRegExpLiterals : true ,
181
- ignoreTemplateLiterals : true ,
182
- ignoreUrls : true ,
183
- tabWidth : 2 ,
184
- } ] ,
185
- 'new-parens' : 'error' ,
186
- 'no-confusing-arrow' : 'error' ,
187
155
'no-constant-condition' : [ 'error' , { checkLoops : false } ] ,
188
156
'no-constructor-return' : 'error' ,
189
157
'no-duplicate-imports' : 'error' ,
190
158
'no-else-return' : 'error' ,
191
- 'no-extra-parens' : [ 'error' , 'functions' ] ,
192
159
'no-lonely-if' : 'error' ,
193
160
'no-mixed-requires' : 'error' ,
194
- 'no-multi-spaces' : [ 'error' , { ignoreEOLComments : true } ] ,
195
- 'no-multiple-empty-lines' : [ 'error' , { max : 2 , maxEOF : 0 , maxBOF : 0 } ] ,
196
161
'no-new-require' : 'error' ,
197
162
'no-path-concat' : 'error' ,
198
163
'no-proto' : 'error' ,
@@ -257,10 +222,8 @@ module.exports = {
257
222
} ,
258
223
] ,
259
224
'no-self-compare' : 'error' ,
260
- 'no-tabs' : 'error' ,
261
225
'no-template-curly-in-string' : 'error' ,
262
226
'no-throw-literal' : 'error' ,
263
- 'no-trailing-spaces' : 'error' ,
264
227
'no-undef' : [ 'error' , { typeof : true } ] ,
265
228
'no-undef-init' : 'error' ,
266
229
'no-unused-expressions' : [ 'error' , { allowShortCircuit : true } ] ,
@@ -276,39 +239,11 @@ module.exports = {
276
239
'no-useless-return' : 'error' ,
277
240
'no-var' : 'error' ,
278
241
'no-void' : 'error' ,
279
- 'no-whitespace-before-property' : 'error' ,
280
- 'object-curly-newline' : 'error' ,
281
- 'object-curly-spacing' : [ 'error' , 'always' ] ,
282
242
'one-var' : [ 'error' , { initialized : 'never' } ] ,
283
- 'one-var-declaration-per-line' : 'error' ,
284
- 'operator-linebreak' : [ 'error' , 'after' ] ,
285
- 'padding-line-between-statements' : [
286
- 'error' ,
287
- { blankLine : 'always' , prev : 'function' , next : 'function' } ,
288
- ] ,
289
243
'prefer-const' : [ 'error' , { ignoreReadBeforeAssign : true } ] ,
290
244
'prefer-object-has-own' : 'error' ,
291
- 'quotes' : [ 'error' , 'single' , { avoidEscape : true } ] ,
292
- 'quote-props' : [ 'error' , 'consistent' ] ,
293
- 'rest-spread-spacing' : 'error' ,
294
- 'semi' : 'error' ,
295
- 'semi-spacing' : 'error' ,
296
- 'space-before-blocks' : [ 'error' , 'always' ] ,
297
- 'space-before-function-paren' : [ 'error' , {
298
- anonymous : 'never' ,
299
- named : 'never' ,
300
- asyncArrow : 'always' ,
301
- } ] ,
302
- 'space-in-parens' : 'error' ,
303
- 'space-infix-ops' : 'error' ,
304
- 'space-unary-ops' : 'error' ,
305
- 'spaced-comment' : [ 'error' , 'always' , {
306
- 'block' : { 'balanced' : true } ,
307
- 'exceptions' : [ '-' ] ,
308
- } ] ,
309
245
'strict' : [ 'error' , 'global' ] ,
310
246
'symbol-description' : 'error' ,
311
- 'template-curly-spacing' : 'error' ,
312
247
'unicode-bom' : 'error' ,
313
248
'valid-typeof' : [ 'error' , { requireStringLiterals : true } ] ,
314
249
@@ -327,6 +262,74 @@ module.exports = {
327
262
'jsdoc/check-tag-names' : 'off' ,
328
263
'jsdoc/require-returns' : 'off' ,
329
264
265
+ // Stylistic rules
266
+ '@stylistic/js/arrow-parens' : 'error' ,
267
+ '@stylistic/js/arrow-spacing' : 'error' ,
268
+ '@stylistic/js/block-spacing' : 'error' ,
269
+ '@stylistic/js/brace-style' : [ 'error' , '1tbs' , { allowSingleLine : true } ] ,
270
+ '@stylistic/js/comma-dangle' : [ 'error' , 'always-multiline' ] ,
271
+ '@stylistic/js/comma-spacing' : 'error' ,
272
+ '@stylistic/js/comma-style' : 'error' ,
273
+ '@stylistic/js/computed-property-spacing' : 'error' ,
274
+ '@stylistic/js/dot-location' : [ 'error' , 'property' ] ,
275
+ '@stylistic/js/eol-last' : 'error' ,
276
+ '@stylistic/js/func-call-spacing' : 'error' ,
277
+ '@stylistic/js/indent' : [ 'error' , 2 , {
278
+ ArrayExpression : 'first' ,
279
+ CallExpression : { arguments : 'first' } ,
280
+ FunctionDeclaration : { parameters : 'first' } ,
281
+ FunctionExpression : { parameters : 'first' } ,
282
+ MemberExpression : 'off' ,
283
+ ObjectExpression : 'first' ,
284
+ SwitchCase : 1 ,
285
+ } ] ,
286
+ '@stylistic/js/key-spacing' : 'error' ,
287
+ '@stylistic/js/keyword-spacing' : 'error' ,
288
+ '@stylistic/js/linebreak-style' : 'error' ,
289
+ '@stylistic/js/max-len' : [ 'error' , {
290
+ code : 120 ,
291
+ ignorePattern : '^// Flags:' ,
292
+ ignoreRegExpLiterals : true ,
293
+ ignoreTemplateLiterals : true ,
294
+ ignoreUrls : true ,
295
+ tabWidth : 2 ,
296
+ } ] ,
297
+ '@stylistic/js/new-parens' : 'error' ,
298
+ '@stylistic/js/no-confusing-arrow' : 'error' ,
299
+ '@stylistic/js/no-extra-parens' : [ 'error' , 'functions' ] ,
300
+ '@stylistic/js/no-multi-spaces' : [ 'error' , { ignoreEOLComments : true } ] ,
301
+ '@stylistic/js/no-multiple-empty-lines' : [ 'error' , { max : 2 , maxEOF : 0 , maxBOF : 0 } ] ,
302
+ '@stylistic/js/no-tabs' : 'error' ,
303
+ '@stylistic/js/no-trailing-spaces' : 'error' ,
304
+ '@stylistic/js/no-whitespace-before-property' : 'error' ,
305
+ '@stylistic/js/object-curly-newline' : 'error' ,
306
+ '@stylistic/js/object-curly-spacing' : [ 'error' , 'always' ] ,
307
+ '@stylistic/js/one-var-declaration-per-line' : 'error' ,
308
+ '@stylistic/js/operator-linebreak' : [ 'error' , 'after' ] ,
309
+ '@stylistic/js/padding-line-between-statements' : [
310
+ 'error' ,
311
+ { blankLine : 'always' , prev : 'function' , next : 'function' } ,
312
+ ] ,
313
+ '@stylistic/js/quotes' : [ 'error' , 'single' , { avoidEscape : true } ] ,
314
+ '@stylistic/js/quote-props' : [ 'error' , 'consistent' ] ,
315
+ '@stylistic/js/rest-spread-spacing' : 'error' ,
316
+ '@stylistic/js/semi' : 'error' ,
317
+ '@stylistic/js/semi-spacing' : 'error' ,
318
+ '@stylistic/js/space-before-blocks' : [ 'error' , 'always' ] ,
319
+ '@stylistic/js/space-before-function-paren' : [ 'error' , {
320
+ anonymous : 'never' ,
321
+ named : 'never' ,
322
+ asyncArrow : 'always' ,
323
+ } ] ,
324
+ '@stylistic/js/space-in-parens' : 'error' ,
325
+ '@stylistic/js/space-infix-ops' : 'error' ,
326
+ '@stylistic/js/space-unary-ops' : 'error' ,
327
+ '@stylistic/js/spaced-comment' : [ 'error' , 'always' , {
328
+ 'block' : { 'balanced' : true } ,
329
+ 'exceptions' : [ '-' ] ,
330
+ } ] ,
331
+ '@stylistic/js/template-curly-spacing' : 'error' ,
332
+
330
333
// Custom rules from eslint-plugin-node-core
331
334
'node-core/no-unescaped-regexp-dot' : 'error' ,
332
335
'node-core/no-duplicate-requires' : 'error' ,
0 commit comments