npm-package-json-lint
npm-package-json-lint copied to clipboard
Unexpected behavior with the `--noConfigFiles` flag
Hi! 👋
I was trying out the CLI and when reading the documentation, I interpreted that if I used the --noConfigFiles flag, I would be able to run the tool (with default configuration/rules) in a project where I don't yet have a configuration file. Looking at the CLI implementation, this flag appears to be ignored. What is the expected behavior for this flag? Is this a bug?
Environment
- npm-package-json-lint: 7.1.0
- npm: 9.8.1
- Node: v18.18.2
Output
Default
npx npmPkgJsonLint .
Output
No npm-package-json-lint configuration found.
/Users/joaopalmeiro/Documents/GitHub/prettier-config/package.json
--noConfigFiles flag
npx npmPkgJsonLint --noConfigFiles .
or
npx npmPkgJsonLint . --noConfigFiles
Output
No npm-package-json-lint configuration found.
/Users/joaopalmeiro/Documents/GitHub/prettier-config/package.json
After adding a configuration file with only the author rule (and removing the author from the package.json file):
{
"rules": {
"require-author": "error"
}
}
npx npmPkgJsonLint .
./package.json
✖ require-author - node: author - author is required
1 error
0 warnings
and
npx npmPkgJsonLint --noConfigFiles .
./package.json
✖ require-author - node: author - author is required
1 error
0 warnings