@@ -37,11 +37,30 @@ const nodeGlobalsConfig = Object.fromEntries(
37
37
)
38
38
39
39
const sharedPlugins = {
40
+ ...nodePlugin . configs [ 'flat/recommended-script' ] . plugins ,
40
41
'sort-destructure-keys' : sortDestructureKeysPlugin ,
41
42
unicorn : unicornPlugin
42
43
}
43
44
44
45
const sharedRules = {
46
+ 'n/exports-style' : [ 'error' , 'module.exports' ] ,
47
+ 'n/no-missing-require' : [ 'off' ] ,
48
+ // The n/no-unpublished-bin rule does does not support non-trivial glob
49
+ // patterns used in package.json "files" fields. In those cases we simplify
50
+ // the glob patterns used.
51
+ 'n/no-unpublished-bin' : 'error' ,
52
+ 'n/no-unsupported-features/es-builtins' : 'error' ,
53
+ 'n/no-unsupported-features/es-syntax' : 'error' ,
54
+ 'n/no-unsupported-features/node-builtins' : [
55
+ 'error' ,
56
+ {
57
+ ignores : [ 'test' , 'test.describe' ] ,
58
+ // Lazily access constants.maintainedNodeVersions.
59
+ version : constants . maintainedNodeVersions . last
60
+ }
61
+ ] ,
62
+ 'n/prefer-node-protocol' : 'error' ,
63
+ 'unicorn/consistent-function-scoping' : 'error' ,
45
64
curly : 'error' ,
46
65
'no-await-in-loop' : 'error' ,
47
66
'no-control-regex' : 'error' ,
@@ -61,8 +80,7 @@ const sharedRules = {
61
80
'no-warning-comments' : [ 'warn' , { terms : [ 'fixme' ] } ] ,
62
81
'prefer-const' : 'error' ,
63
82
'sort-destructure-keys/sort-destructure-keys' : 'error' ,
64
- 'sort-imports' : [ 'error' , { ignoreDeclarationSort : true } ] ,
65
- 'unicorn/consistent-function-scoping' : 'error'
83
+ 'sort-imports' : [ 'error' , { ignoreDeclarationSort : true } ]
66
84
}
67
85
68
86
const sharedRulesForImportX = {
@@ -243,31 +261,13 @@ export default [
243
261
plugins : {
244
262
...jsPlugin . configs . recommended . plugins ,
245
263
...importFlatConfigsForScript . recommended . plugins ,
246
- ...nodePlugin . configs [ 'flat/recommended-script' ] . plugins ,
247
264
...sharedPlugins
248
265
} ,
249
266
rules : {
250
267
...jsPlugin . configs . recommended . rules ,
251
268
...importFlatConfigsForScript . recommended . rules ,
252
269
...nodePlugin . configs [ 'flat/recommended-script' ] . rules ,
253
- ...sharedRules ,
254
- 'n/exports-style' : [ 'error' , 'module.exports' ] ,
255
- 'n/no-missing-require' : [ 'off' ] ,
256
- // The n/no-unpublished-bin rule does does not support non-trivial glob
257
- // patterns used in package.json "files" fields. In those cases we simplify
258
- // the glob patterns used.
259
- 'n/no-unpublished-bin' : 'error' ,
260
- 'n/no-unsupported-features/es-builtins' : 'error' ,
261
- 'n/no-unsupported-features/es-syntax' : 'error' ,
262
- 'n/no-unsupported-features/node-builtins' : [
263
- 'error' ,
264
- {
265
- ignores : [ 'test' , 'test.describe' ] ,
266
- // Lazily access constants.maintainedNodeVersions.
267
- version : constants . maintainedNodeVersions . last
268
- }
269
- ] ,
270
- 'n/prefer-node-protocol' : 'error'
270
+ ...sharedRules
271
271
}
272
272
} ,
273
273
{
0 commit comments