Reputation: 14558
i have a pattern that is used all over my codebase that throws a frivolous warning on jshint.
I got the reason for the warning using --verbose
. it is W002
.
I can disable that warning on each js file by adding /*jshint -W002*/
but i can't see any way to disable that warning by instead of editing every single file, adding an option on my global jshint.json configuration file.
Is there any way to do that?
edit: seems to be a common problem
Upvotes: 3
Views: 707
Reputation: 123218
I was about to ask this question, then I found the answer myself.
A trailing decimal point can be confused with a dot
The warning ID is W047
. jslinterrors can help find the warning IDs.
.jshintrc
:} "-W047": true }
The syntax is really poor with the magic numbers (commonly regarded as a bad idea in programming) - eslint does it better - but that's how to globally ignore a warning.
Upvotes: 1