check-eslint-config-compat is a CLI tool to compare eslint config compatibility.
node > v18.18.0
eslint > v8
npm install -g @sajikix/check-eslint-config-compat@latest
or
npx @sajikix/check-eslint-config-compat@latest [command] [options]
The use of this tool is divided into two steps.
- export compatibility data based on the old config.
- check the compatibility with the new config based on the data of step 1.
First, use the extract
command to output the "compat" data.
@sajikix/check-eslint-config-compat extract -c .eslintrc.js -e js,jsx -t ./
Then compat dat (about the lint rule, target files and more...) will be output in JSON.(If not specified in option, the file name will be .compat.json
)
The compare
command report differences between the environment in which the extract command was executed and the current environment.
@sajikix/check-eslint-config-compat compare -c eslint.config.js -i .compat.json -t ./
It report the differences in rules and settings adapted to the files.
required
Option for eslint config filepath.(Currently only the old eslintrc format is supported)
default: ("./src")
Option for eslint target directory.
default: ("js")
Option for file extensions to be checked by eslint.
default: ("./.compat.json")
Option for Path of compat json file.
default: ("./.compat.json")
Option for Path to compat json file.