I have this in my package.json
"scripts": {
"lint": "eslint --quiet .",
"lint:prcleancode": "eslint -c ./ci/.eslint-cleancode.json
The first lint
command is configured with the .eslintrc.json
file (in the project's root).
I expected that the lint:prcleancode
command will get it's configuration from the file in ./ci/.eslint-cleancode.json
. But it still uses the .eslintrc.json
in the root folder. Any idea why?
Turns out that if you have a eslintre.json
in your root folder, you need to add:
--no-eslintrc
flag.
"lint:prcleancode": "eslint --no-eslintrc -c ./ci/.eslint-
cleancode.json .",`
source:
If you are using one configuration file and want ESLint to ignore any .eslintrc.* files, make sure to use --no-eslintrc along with the --config flag.
https://eslint.org/docs/latest/use/configure/configuration-files