-
Notifications
You must be signed in to change notification settings - Fork 5
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
This plugin breaks other plugins that lint JSON #40
Comments
Try to explicitly add eslint-plugin-json to the plugins array. Did not test this, but in my understanding your plugins array with only "json-files" in it overwrites the plugins section of the default eslint-plugin-json config so it is not included and therefore never started.
|
Just tried it. It doesn't help. |
Any update on this issue? Wonder if we can allow configuring it from outside, or add a better check there. My current solution is to use patch-package to change this file 😕 |
I fixed this by using ESLint {
"root": true,
"overrides": [
/*
* JSON files.
*/
{
"files": ["*.json"],
"extends": [
"plugin:json/recommended-with-comments"
]
},
/*
* `package.json` file.
* This needs it's own configuration, because it doesn't work together with `plugin:json`.
* See https://github.com/kellyselden/eslint-plugin-json-files/issues/40
*/
{
"files": ["package.json"],
"plugins": ["json-files"],
"extends": [ ],
"rules": {
"json-files/rule-name": "error"
}
}
]
} |
I am also hitting this. Using override trick didn't work for me, as I want to lint package.json specifically with the other module. @barakyosi can you share what about /lib/processors/json.js#L25 that you are changing to fix it? and or submit a PR to fix it? |
I think this is happening because this plugin adds a (deprecated) file extension-based processor for all I can't find any way around this (other than patch-package), since there doesn't seem to be a way to override a file extension based processor (at least that I can find). I think the only way to fix this may be an internal refactor of this plugin to use a different approach for preventing it's rules from running on non-json files (which is the intent of the postprocessor), or to migrate away from the deprecated file-extension-based processor. |
eslint-plugin-json stops working (stops giving any warnings about
*.json
files) when I addjson-files
to my.eslintrc
:If I remove
"plugins": ["json-files"]
from the above config, eslint-plugin-json starts working again.The text was updated successfully, but these errors were encountered: