Skip to content

Commit f3ca6a0

Browse files
authored
Switch run-rules-on-codebase script to use ESLint CLI directly (#2402)
1 parent cb7abc5 commit f3ca6a0

File tree

3 files changed

+48
-121
lines changed

3 files changed

+48
-121
lines changed

eslint.dogfooding.config.mjs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/* Run all unicorn rules on codebase */
2+
/*
3+
! If you're making a new rule, you can ignore this before review.
4+
*/
5+
6+
import eslintPluginUnicorn from './index.js';
7+
8+
const config = [
9+
eslintPluginUnicorn.configs['flat/all'],
10+
{
11+
linterOptions: {
12+
reportUnusedDisableDirectives: false,
13+
},
14+
},
15+
{
16+
ignores: [
17+
'coverage',
18+
'test/integration/fixtures',
19+
'test/integration/fixtures-local',
20+
'rules/utils/lodash.js',
21+
],
22+
},
23+
{
24+
rules: {
25+
// https://github.com/sindresorhus/eslint-plugin-unicorn/issues/1109#issuecomment-782689255
26+
'unicorn/consistent-destructuring': 'off',
27+
// https://github.com/sindresorhus/eslint-plugin-unicorn/issues/2341
28+
'unicorn/escape-case': 'off',
29+
'unicorn/no-hex-escape': 'off',
30+
// Buggy
31+
'unicorn/custom-error-definition': 'off',
32+
'unicorn/consistent-function-scoping': 'off',
33+
// Annoying
34+
'unicorn/no-keyword-prefix': 'off',
35+
},
36+
},
37+
{
38+
files: [
39+
'**/*.js',
40+
],
41+
rules: {
42+
'unicorn/prefer-module': 'off',
43+
},
44+
},
45+
];
46+
47+
export default config;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"lint:js": "xo",
3030
"lint:markdown": "markdownlint \"**/*.md\"",
3131
"lint:package-json": "npmPkgJsonLint .",
32-
"run-rules-on-codebase": "node ./test/run-rules-on-codebase/lint.mjs",
32+
"run-rules-on-codebase": "eslint --config=./eslint.dogfooding.config.mjs",
3333
"smoke": "eslint-remote-tester --config ./test/smoke/eslint-remote-tester.config.mjs",
3434
"test": "npm-run-all --continue-on-error lint test:*",
3535
"test:js": "c8 ava"

test/run-rules-on-codebase/lint.mjs

Lines changed: 0 additions & 120 deletions
This file was deleted.

0 commit comments

Comments
 (0)