Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected behavior with the --noConfigFiles flag #1260

Open
joaopalmeiro opened this issue Feb 22, 2024 · 1 comment
Open

Unexpected behavior with the --noConfigFiles flag #1260

joaopalmeiro opened this issue Feb 22, 2024 · 1 comment

Comments

@joaopalmeiro
Copy link

joaopalmeiro commented Feb 22, 2024

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
@joaopalmeiro joaopalmeiro changed the title Unexpected behavior with the --noConfigFiles` flag Unexpected behavior with the --noConfigFiles flag Feb 22, 2024
@joaopalmeiro
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant