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
Configuration for rule "indent" is invalid error when running a full path file. #9479
Comments
Hi, thanks for the report.
Was this a typo? This version of ESLint doesn't exist.
It doesn't seem like you have the
Actually, we follow a semantic versioning policy which requires that we only make breaking changes in major releases. Moreover, we don't make breaking changes to rule schemas at all. The goal of this is to allow users to upggrade easily, and only receive breaking changes when they opt-in to a new major version. If you find that we accidentally make a breaking change outside of a major release, I would encourage you to report an issue like you've done here. (In this case, I suspect that this may be a configuration issue on your end, given that we haven't received any other reports about a broken config file.) |
I looked back on all the command I run, yes you are right, 4.9.0 is the version I installed: npm install -g eslint@4.9.0. I reported the version number based on following command's result:
C:\work\temp>npm -v eslint
2.15.5
for the configuration file, since I tried an old package.json file which had run fine for a quite while one year ago. For the latest try it didn't work and gave errors, so I tried to strip off different part of the old configuration file to make it work with the current node and eslint. It didn't go well, so I started with a bare version of file published on the official site:{ "parserOptions": { "ecmaVersion": 6, "sourceType": "module", "ecmaFeatures": { "jsx": true } }, "rules": { "no-eval": 1,... }
}
Seems the first portion is optional so I removed that too. One year ago when the old config run very stable for quite a while before we stopped the run for some internal process reason. It didn't have indent defined. With the above bare boned config file it doesn't either and runs fine.
On Wednesday, October 18, 2017, 3:51:24 PM PDT, Teddy Katz <notifications@github.com> wrote:
Hi, thanks for the report.
ESLint version: 2.15.5
Was this a typo? This version of ESLint doesn't exist.
{
"rules": {
"no-eval": 1
}
}
It doesn't seem like you have the indent rule configured at all. If you omitted your indent rule configuration, could you please include it? It's difficult for me to debug your "invalid rule configuration" error without knowing the configuration that you supplied to the rule.
A big issue with this great tool is all the breaking changes it introduces all the time, what worked fine half year ago no longer work today, and when you spend a lot of time, it may break again in a few months.
Actually, we follow a semantic versioning policy which requires that we only make breaking changes in major releases. Moreover, we don't make breaking changes to rule schemas at all. The goal of this is to allow users to upggrade easily, and only receive breaking changes when they opt-in to a new major version.
If you find that we accidentally make a breaking change outside of a major release, I would encourage you to report an issue like you've done here. (In this case, I suspect that this may be a configuration issue on your end, given that we haven't received any other reports about a broken config file.)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Thanks for the clarification.
Could you show me the configuration that caused errors? In the original issue, you reported a problem where ESLint was outputting an error along the lines of "Configuration for rule 'indent' is invalid:". Could you show me what configuration you were using when that error was produced? If this is a bug in ESLint, then I'd like to figure out what's causing the bug so that I can fix it. But you will have to provide enough information for me to reproduce the bug. |
Hi @happyhebaby, thanks for the issue. It looks like there's not enough information for us to know how to help you. If you're reporting a bug, please be sure to include:
Requesting a new rule? Please see Proposing a New Rule for instructions. Requesting a rule change? Please see Proposing a Rule Change for instructions. If it's something else, please just provide as much additional information as possible. Thanks! |
Before the config is as simple as the following to trigger the error: However, after the machine rebooted with a bunch of updates. The error went away. I will close the bug for now. If in future I can repro. I will re-open it. Thanks. |
I just repro the issue again. This time I execute eslint from current directory(c:\work\temp) against another full path directory, in that full path directory there is a different package.json. I run eslint with -c option which points to the desired package.json in my working directory c:\work\temp, but eslint seems to ignore that option and still try to pick up the package.json from the targeted directory. It gave the exact same error. Command I used: c:\work\temp>eslint -c package.json --rulesdir C:\mycompany\SecTools\Code\nodejs\NodeJSSecRun\eslint\eslint-rules c:\mycompany\GoogleChromeExtension |
Is there an |
It has a different package.json, no other config object. I think this problem existed one year ago when I wrote my initial implementation. There is a work around for this: copy the desired package.json to the targeted dir, it will work, but this looks like a bug too me. |
And I am not sure the purpose of using multiple types of config file like .eslintrc.json and package.json, why not just use one file? This adds confusion and extra complicity to the user. |
I'm going to close this issue because I can't reproduce it and you haven't followed the instructions in the issue template. Feel free to create another issue and follow those instructions. |
Other than source code, which I couldn't share due to company policy. I shared all the info asked by the template. I also provided detailed repro steps. Not sure what info you are looking for that hasn't been provided. A good programmer should always investigate and fix bugs in code... |
I did investigate the issue, and I found that I couldn't reproduce it based on the steps that you've provided. I think it's most likely that you have an invalid config file somewhere. |
Hi Teddy, I just want to clarify my scenario: I specified a valid config with the -c option. I am not sure if the config file under the scanned dir works with the eslint version installed, but the point is eslint should use the correct config file specified with the -c option, the other config files living in some other places are valid or not shouldn't matter, if I understand correctly? When I experiment different eslint version with different nodejs version, the behavior is different. Are you using the exact versions with both and exactly my config file. I guess I can provide one sample custom rule to allow you to simulate the exact running setup I have. Let me know if you need that custom rule file. We run a bunch of custom rules but just one will repro this.
On Monday, October 23, 2017, 11:11:28 AM PDT, Teddy Katz <notifications@github.com> wrote:
I did investigate the issue, and I found that I couldn't reproduce it based on the steps that you've provided. I think it's most likely that you have an invalid config file somewhere.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Thanks for clarifying. I think the |
I can confirm with this extra option it works properly now. I am not a javascript guy but this multiple config file setup is very confusing to users, not sure the design decision why not using a single config file to control the run. Especially when you have -c option which normally means exclusively using config definitions from the specified config file by almost all the other tools that I have used.
On Monday, October 23, 2017, 1:22:19 PM PDT, Teddy Katz <notifications@github.com> wrote:
Reopened #9479.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Yeah, I agree that it's sort of confusing for |
Closing in favor of #9535 |
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
default
Please show your full configuration:
basically a bare version of custom rules that I implemented. I had to remove the bulk portion of a working config from the package.json file as they no longer work current version and gave all sorts of errors.
{
"rules": {
"no-eval": 1,
...omitted other rules
}
}
What did you do? Please include the actual source code causing the issue.
If I run the following command pointing to the rules dir and a local js file, it runs fine:
eslint -c package.eslint.json --rulesdir C:\mycompany\SecTools\Code\nodejs\NodeJSSecRun\eslint\eslint-rules app.js
If I run the same command to a full path file, basically change app.js to c:\foo\bar\app.js
It will error:
Error: c:\mycompany\GoogleChromeExtension\package.json:
Configuration for rule "indent" is invalid:
Value "[object Object]" should NOT have additional properties.
If I just run against a full path dir then it also runs ok.
Let me know if you need any other info.
A big issue with this great tool is all the breaking changes it introduces all the time, what worked fine half year ago no longer work today, and when you spend a lot of time, it may break again in a few months.
The text was updated successfully, but these errors were encountered: