Skip to content
Snippets Groups Projects
Commit d8d68a8a authored by neon-dev's avatar neon-dev Committed by Marijn Haverbeke
Browse files

[javascript-lint addon] Fix incorrect severity

When enabling strict equality checks via `lint: {options: {eqeqeq: true}}`, found problems showed up as errors instead of warnings.
To fix it, the `fixWith()` logic had to be changed since simply adding the phrase to the warnings array would not have worked. This is because both the warnings and errors array matched this exact error and therefore the severity could never be "warning" (errors were checked after warnings).

I didn't include "Missing property name" and "Unmatched " in the new error array since they already are errors with the new logic.
"Stopping, unable to continue" also got removed since it didn't appear anywhere in the current jshint.js.

For now I've implemented everything to not break previous behavior/hinting, except the strict equality hint severity. Although I want to suggest removing the following codes from the new error array (so they can stay warnings):
- W033 (Missing semicolon) - since erroneous missing semicolons have their own code: E058
- W084 (Expected a conditional expression and instead saw an assignment) - since something like `switch (var2 = var1 + 42)` is valid js code, though not recommendable
- maybe W023/24/30/90, since there are many more " and instead saw an" hints that are already errors with their own codes, so I think they should be pretty accurate. Unfortunately I couldn't force these warnings so I couldn't check.
parent 97418246
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment