Skip to content

Commit a7761f9

Browse files
authored
Expand config file names allowed to use devDependencies (#184)
Expands the file extensions allowed to use `devDependencies` in the `import/no-extraneous-dependencies` rule. For older config files expands to js and cjs. For newer files that are esm aware also includes the esm extensions. --------- Co-authored-by: rajsite <1588923+rajsite@users.noreply.github.com>
1 parent 7df5f9c commit a7761f9

2 files changed

Lines changed: 26 additions & 23 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Expand config file names allowed to use devDependencies",
4+
"packageName": "@ni/eslint-config-javascript",
5+
"email": "1588923+rajsite@users.noreply.github.com",
6+
"dependentChangeType": "patch"
7+
}

packages/eslint-config-javascript/lib/imports.js

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -88,30 +88,26 @@ export const imports = defineConfig([{
8888
'spec/**', // mocha, rspec-like pattern
8989
'**/__tests__/**', // jest pattern
9090
'**/__mocks__/**', // jest pattern
91-
'test.{js,jsx}', // repos with a single test file
92-
'test-*.{js,jsx}', // repos with multiple top-level test files
93-
'**/*{.,_}{test,spec}.{js,jsx}', // tests where the extension or filename suffix denotes that it is a test
94-
'**/jest.config.js', // jest config
95-
'**/jest.setup.js', // jest setup
96-
'**/vue.config.js', // vue-cli config
97-
'**/webpack.config.js', // webpack config
98-
'**/webpack.config.*.js', // webpack config
99-
'**/rollup.config.js', // rollup config
100-
'**/rollup.config.*.js', // rollup config
101-
'**/gulpfile.js', // gulp config
102-
'**/gulpfile.*.js', // gulp config
103-
'**/Gruntfile{,.js}', // grunt config
104-
'**/protractor.conf.js', // protractor config
105-
'**/protractor.conf.*.js', // protractor config
106-
'**/karma.conf.js', // karma config
107-
'**/.eslintrc.js', // legacy eslint config
91+
'test.{js,cjs,mjs,ts,cts,mts,jsx,tsx}', // repos with a single test file
92+
'test-*.{js,cjs,mjs,ts,cts,mts,jsx,tsx}', // repos with multiple top-level test files
93+
'**/*{.,_}{test,spec}.{js,cjs,mjs,ts,cts,mts,jsx,tsx}', // tests where the extension or filename suffix denotes that it is a test
94+
'**/jest.config.{js,cjs}', // jest config
95+
'**/jest.setup.{js,cjs}', // jest setup
96+
'**/vue.config.{js,cjs}', // vue-cli config
97+
'**/webpack.config.{js,cjs}', // webpack config
98+
'**/webpack.config.*.{js,cjs}', // webpack config
99+
'**/rollup.config.{js,cjs,mjs}', // rollup config
100+
'**/rollup.config.*.{js,cjs,mjs}', // rollup config
101+
'**/gulpfile.{js,cjs}', // gulp config
102+
'**/gulpfile.*.{js,cjs}', // gulp config
103+
'**/Gruntfile{,.js,.cjs}', // grunt config
104+
'**/protractor.conf.{js,cjs}', // protractor config
105+
'**/protractor.conf.*.{js,cjs}', // protractor config
106+
'**/karma.conf.{js,cjs}', // karma config
107+
'**/karma.conf.*.{js,cjs}', // karma config
108+
'**/.eslintrc.{js,cjs}', // legacy eslint config
108109
// The following eslint.config.* files are supported by ESLint >=9.
109-
'**/eslint.config.cjs',
110-
'**/eslint.config.cts',
111-
'**/eslint.config.js',
112-
'**/eslint.config.mjs',
113-
'**/eslint.config.mts',
114-
'**/eslint.config.ts'
110+
'**/eslint.config.{js,cjs,mjs,ts,cts,mts}',
115111
],
116112
optionalDependencies: false,
117113
}],

0 commit comments

Comments
 (0)