-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[[FIX]] Removed warning message W041 #3115
Conversation
This commit removes the warning message W041 altogether from the jshint project. Fixes jshint#3109
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch, @sunilkumarc! I've left some feedback for you as in-line comments. Beyond those, could you remove the changes to the files in the dist/
directory? Those files are re-written during the release process (not for each change to the source).
@@ -121,7 +121,6 @@ var warnings = { | |||
W039: "'{a}' is not allowed.", | |||
W040: "If a strict mode function is executed using function invocation, " + | |||
"its 'this' value will be undefined.", | |||
W041: "Use '{a}' to compare with '{b}'.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you declare this property as null
instead? Doing so is consistent with how we've handled invalid warnings in the past, and it makes it more clear to future readers that the "missing" warning is intentional.
tests/helpers/testhelper.js
Outdated
undefinedErrors.length === 0 && | ||
unthrownErrors.length === 0 && | ||
wrongLineNumbers.length === 0 && | ||
duplicateErrors.length === 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change effectively disables the unit test suite. Since we want to continue
running tests for all the rest of the functionality, we'll have to be more
specific about which tests are invalidated by this change. Could you
re-introduce this code and instead remove the specific assertions that relate
to warning W041?
Hi @jugglinmike . I have made all the changes you suggested. I have one question regarding the last suggestion, that is, disabling unit test suites to avoid only W041 assertions. My question is, there are some unit tests with only assertions for W041 messages. In such a case should I remove the entire unit test or just the assertions? For example, in the below code, should I just remove just all the
|
Hi @jugglinmike. Did you get time to look at my above comment? |
No, not yet. |
No problem. You can check and reply in your free time :) |
Good question. It's probably safest to retain the test itself. It may be |
This commit removes the warning message W041 and the corresponding assertions from junits. Fixes jshint#3109
Hi @jugglinmike. I have made the changes you suggested and pushed the changes. Please check now. |
This is looking good, @sunilkumarc! In reviewing these changes, I've learned Rick: for context, here's what we know:
This situation is confusing for users because even if they "disable" What I've just learned, though, is that a second linting option, This has expanded the scope of the "fix" I suggested--we are now considering Maybe I'm just being sentimental, though. If a linting option is only relevant So what do you think, @rwaldron and @sunilkumarc? Should we proceed with this |
Sorry for the delay here, @sunilkumarc. I happen to know that @rwaldron has had |
No problems at all @jugglinmike :) I can wait. |
Thanks @sunilkumarc and @jugglinmike |
Thanks @rwaldron. Thanks a lot @jugglinmike, for all the help. 👍 |
No problem at all, @sunilkumarc! Thank you for your contribution and your patience! |
* [[FIX]] Removed warning message W041 This commit removes the warning message W041 altogether from the jshint project. Fixes jshint#3109 * [[FIX]] Removed warning message W041 This commit removes the warning message W041 and the corresponding assertions from junits. Fixes jshint#3109
This commit removes the warning message W041 altogether from the jshint
project.
Fixes #3109