2.1.0 • Published 2 years ago
compare-eslint-configs v2.1.0
Compare ESLint configs
Usage
npm install -g compare-eslint-configs
compare-eslint-configs .eslintrc new.eslintrcOr simply:
npx compare-eslint-configs .eslintrc new.eslintrcExample
CLI output
npx compare-eslint-configs new.eslintrc -t cli.js
Markdown output
npx compare-eslint-configs new.eslintrc -t cli.js -mOnly active in some:
- new.eslintrc
Mixed severities:
- func-style
- warn: .eslintrc
- error: new.eslintrc
- unicorn/prefer-event-target
- warn: .eslintrc
- error: new.eslintrc
Mixed configs where otherwise okay:
- no-console
- new.eslintrc:
[{"allow":["warn","error"]}]
Syntax
compare-eslint <eslint config files, separated by spaces>If a single config file is given, then it will be assumed to be compared with .eslintrc.
More than two config files can be compafred at once.
Flags
-r/--group-rules– when set the comparison output will group by rules rather than config-t <file>/--target-file <file>– defaults toindex.js– the file for which the config will be compared. Especially important when there's eg. different configs for.jsand.tsfiles. Then point this to the one you want to do a comparison on.
See also
@voxpelli/eslint-formatter-summary– can summarize errors/warnings by ESLint rule + print that list as markdown