Skip to content

Commit

Permalink
Switch run-rules-on-codebase script to use ESLint CLI directly (#2402)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker authored Jul 16, 2024
1 parent cb7abc5 commit f3ca6a0
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 121 deletions.
47 changes: 47 additions & 0 deletions eslint.dogfooding.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* Run all unicorn rules on codebase */
/*
! If you're making a new rule, you can ignore this before review.
*/

import eslintPluginUnicorn from './index.js';

const config = [
eslintPluginUnicorn.configs['flat/all'],
{
linterOptions: {
reportUnusedDisableDirectives: false,
},
},
{
ignores: [
'coverage',
'test/integration/fixtures',
'test/integration/fixtures-local',
'rules/utils/lodash.js',
],
},
{
rules: {
// https://github.com/sindresorhus/eslint-plugin-unicorn/issues/1109#issuecomment-782689255
'unicorn/consistent-destructuring': 'off',
// https://github.com/sindresorhus/eslint-plugin-unicorn/issues/2341
'unicorn/escape-case': 'off',
'unicorn/no-hex-escape': 'off',
// Buggy
'unicorn/custom-error-definition': 'off',
'unicorn/consistent-function-scoping': 'off',
// Annoying
'unicorn/no-keyword-prefix': 'off',
},
},
{
files: [
'**/*.js',
],
rules: {
'unicorn/prefer-module': 'off',
},
},
];

export default config;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"lint:js": "xo",
"lint:markdown": "markdownlint \"**/*.md\"",
"lint:package-json": "npmPkgJsonLint .",
"run-rules-on-codebase": "node ./test/run-rules-on-codebase/lint.mjs",
"run-rules-on-codebase": "eslint --config=./eslint.dogfooding.config.mjs",
"smoke": "eslint-remote-tester --config ./test/smoke/eslint-remote-tester.config.mjs",
"test": "npm-run-all --continue-on-error lint test:*",
"test:js": "c8 ava"
Expand Down
120 changes: 0 additions & 120 deletions test/run-rules-on-codebase/lint.mjs

This file was deleted.

0 comments on commit f3ca6a0

Please sign in to comment.