@@ -10,7 +10,7 @@ const sortDestructureKeysPlugin = require('eslint-plugin-sort-destructure-keys')
1010const unicornPlugin = require ( 'eslint-plugin-unicorn' )
1111
1212const constants = require ( '@socketsecurity/registry/lib/constants' )
13- const { GIT_IGNORE , PRETTIER_IGNORE } = constants
13+ const { GIT_IGNORE , LATEST , PRETTIER_IGNORE } = constants
1414
1515const rootPath = __dirname
1616
@@ -25,9 +25,12 @@ module.exports = [
2525 ...importXPlugin . flatConfigs . recommended ,
2626 languageOptions : {
2727 ...importXPlugin . flatConfigs . recommended . languageOptions ,
28- ecmaVersion : 'latest' ,
28+ ecmaVersion : LATEST ,
2929 sourceType : 'script'
3030 } ,
31+ linterOptions : {
32+ reportUnusedDisableDirectives : 'off'
33+ } ,
3134 rules : {
3235 ...importXPlugin . flatConfigs . recommended . rules ,
3336 'import-x/no-named-as-default-member' : 'off' ,
@@ -58,17 +61,10 @@ module.exports = [
5861 }
5962 } ,
6063 {
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' ] ,
7066 rules : {
71- ...js . configs . recommended . rules ,
67+ ...nodePlugin . configs [ 'flat/ recommended-script' ] . rules ,
7268 'n/exports-style' : [ 'error' , 'module.exports' ] ,
7369 // The n/no-unpublished-bin rule does does not support non-trivial glob
7470 // patterns used in package.json "files" fields. In those cases we simplify
@@ -85,6 +81,16 @@ module.exports = [
8581 }
8682 ] ,
8783 '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 ,
8894 'no-await-in-loop' : [ 'error' ] ,
8995 'no-control-regex' : [ 'error' ] ,
9096 'no-empty' : [ 'error' , { allowEmptyCatch : true } ] ,
0 commit comments