@@ -10,7 +10,7 @@ const sortDestructureKeysPlugin = require('eslint-plugin-sort-destructure-keys')
10
10
const unicornPlugin = require ( 'eslint-plugin-unicorn' )
11
11
12
12
const constants = require ( '@socketsecurity/registry/lib/constants' )
13
- const { GIT_IGNORE , PRETTIER_IGNORE } = constants
13
+ const { GIT_IGNORE , LATEST , PRETTIER_IGNORE } = constants
14
14
15
15
const rootPath = __dirname
16
16
@@ -25,9 +25,12 @@ module.exports = [
25
25
...importXPlugin . flatConfigs . recommended ,
26
26
languageOptions : {
27
27
...importXPlugin . flatConfigs . recommended . languageOptions ,
28
- ecmaVersion : 'latest' ,
28
+ ecmaVersion : LATEST ,
29
29
sourceType : 'script'
30
30
} ,
31
+ linterOptions : {
32
+ reportUnusedDisableDirectives : 'off'
33
+ } ,
31
34
rules : {
32
35
...importXPlugin . flatConfigs . recommended . rules ,
33
36
'import-x/no-named-as-default-member' : 'off' ,
@@ -58,17 +61,10 @@ module.exports = [
58
61
}
59
62
} ,
60
63
{
61
- files : [ 'scripts/**/*.js' , 'test/**/*.cjs' ] ,
62
- ...nodePlugin . configs [ 'flat/recommended-script' ]
63
- } ,
64
- {
65
- files : [ 'scripts/**/*.js' , 'test/**/*.cjs' ] ,
66
- plugins : {
67
- 'sort-destructure-keys' : sortDestructureKeysPlugin ,
68
- unicorn : unicornPlugin
69
- } ,
64
+ files : [ 'scripts/**/*.{c,}js' , 'test/**/*.{c,}js' ] ,
65
+ ...nodePlugin . configs [ 'flat/recommended-script' ] ,
70
66
rules : {
71
- ...js . configs . recommended . rules ,
67
+ ...nodePlugin . configs [ 'flat/ recommended-script' ] . rules ,
72
68
'n/exports-style' : [ 'error' , 'module.exports' ] ,
73
69
// The n/no-unpublished-bin rule does does not support non-trivial glob
74
70
// patterns used in package.json "files" fields. In those cases we simplify
@@ -85,6 +81,16 @@ module.exports = [
85
81
}
86
82
] ,
87
83
'n/prefer-node-protocol' : [ 'error' ] ,
84
+ }
85
+ } ,
86
+ {
87
+ files : [ 'scripts/**/*.{c,}js' , 'test/**/*.{c,}js' ] ,
88
+ plugins : {
89
+ 'sort-destructure-keys' : sortDestructureKeysPlugin ,
90
+ unicorn : unicornPlugin
91
+ } ,
92
+ rules : {
93
+ ...js . configs . recommended . rules ,
88
94
'no-await-in-loop' : [ 'error' ] ,
89
95
'no-control-regex' : [ 'error' ] ,
90
96
'no-empty' : [ 'error' , { allowEmptyCatch : true } ] ,
0 commit comments