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
v3 not reading configuration from package.json
#79
Comments
Hi @ntwb - thank you for the detailed information and for helping test the beta! Can you confirm that you moved the config to your P.S. I'm getting really close to completely the documentation for v3. v3 will release after that! |
Indeed I moved it to the root repo |
Hmmm, I just created a test repo, its a single file in a folder of its own: {
"name": "npj79",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"npmPackageJsonLintConfig": {
"rules": {
"require-publishConfig": "error",
"valid-values-author": ["error", [
"My Name"
]]
}
}
} And running |
Ahhh, I see what is happening, indeed it is what you suspected, in "If so, I think I made a bad assumption. Right now config in package json files don't recursively search up the directory tree." https://www.npmjs.com/package/cosmiconfig is great at "recursively search up the directory tree" if you're interested |
👍 Do you know if cosmicconfig supports config extension? I would like to keep the I think the change to fix this issue should be pretty quick. I'm currently recursively scanning up the project hierarchy, but I'm not checking the |
I believe it does, we use cosmiconfig with stylelint and stylelint supports |
It doesn't, see cosmiconfig/cosmiconfig#40 which is a follow up to cosmiconfig/cosmiconfig#1 As noted in 1 above, https://github.com/chrisblossom/ex-config was created to handle extends with cosmiconfig This all looks like it would involve much more refactoring on your behalf, I'll leave it with you |
Hey @ntwb - a new beta version has been published. Please let me know if it is working for you. If it is, I'll publish v3 tomorrow! |
@tclindner I've just updated to v3 and I'm still seeing this issue. In my PR I've got a When I run any of these commands they all result in the same error: Error:
I currently have a I plan on removing the Any thoughts on if I may have missed something in updating to v3 maybe? |
Hey @ntwb I'm sorry you are still experiencing this issue. I unfortunately didn't have time to take a look at this today. I will take a look at it tomorrow and get back to you. I hope you had a nice weekend! |
npx -p npm-package-json-lint@beta -c "npmPkgJsonLint ."
6.0.0
8.11.1
In a
.npmpackagejsonlintrc.json
file in the root of my repo I had:The output from the above:
I then copied the above (and deleted the
.npmpackagejsonlintrc.json
file) to mypackage.json
:When I run
npx -p npm-package-json-lint@beta -c "npmPkgJsonLint ."
I get the following result:npx: installed 81 in 4.315s No npm-package-json-lint configuration found. ./packages/package1/package.json
I expected using the above command that
npmPkgJsonLint
would load the config that is now in mypackage.json
file.The text was updated successfully, but these errors were encountered: