-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
I can't set linting options #3102
Comments
Also I tried the following file
then I typed:
and still the linting options do not take effect. Could anyone kindly help!? I'm working around for 1 day and I can't figure out what I am doing wrong. |
Does it work if you use |
Nope, now as I type And according to the documentation when set to true, these options will make JSHint produce more warnings about your code. edit: I set |
This is very strange. Could you share the input code, preferably reduced as |
By "the input code," I meant, "the JavaScript program that you are linting." |
Sure, I attach here The first error appears, as you can see on the above shell, on line 63, which is simply:
|
If I try a file with only this simple code, it gives the same warning
But it seems that it appears only while comparing with '0', because this code gives no error
Is it supposed to be like that? |
The The option's description states, "This options prohibits the use of == and != The long-term resolution for the project, removing W041 altogether. It's a The short-term resolution for users is to disable W041 in your project // jshint -W041 Or within a JSHint configuration file: {
"-W041": true
} |
==
/!==
reported too aggressively
Thank you for your message But your option |
Can you be more specific? For instance, if I paste the following code into the if (x == 0) {} ...then I see the following warning:
However, when I insert that option, the warning is suppressed: // jshint -W041: true
if (x == 0) {} How does your experience differ? |
==
/!==
reported too aggressively==
/!=
reported too aggressively
In that case, we'll need to ensure that JSHint is actually reading that file. Can you try deliberately inserting a JSON syntax error--for instance: {
"-W041": true,
this is not valid JSON
} If everything is configured properly, JSHint should report a syntax error in the configuration file. If it does not, then JSHint isn't reading that file at all. |
Remove the trailing comma: {
"-W041": true
} |
@josephzidell I was told not to by @jugglinmike so we can test the config file, check previous message |
I'm still unable to reproduce the error. This is very tricky. Since it seems to https://github.com/jshint/gh-3102 Can you clone that repository, follow the instructions, and let me know what |
It seems that it does not save the configuration file, because when I run just in one line, it works, but when I use in two command lines, it doesn't work it doesn't work
it does work
It's working now 👍 |
Ah, yes--the command-line interface is stateless, so one invocation will not This issue has grown a bit unwieldy, making it a little confusing for use as a Glad we got to the bottom of this one! |
==
/!=
reported too aggressively
Yes. Thank you for the support
|
I have a config.json file
I typed
jshint --config "/path/to/my/config.json"
and still I get errors/warnings regarding "==" and "==="
What is wrong?
The text was updated successfully, but these errors were encountered: