-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make 'unused' check smarter about unused arguments.
This patch modifies 'unused' checks so that they ignore arguments that were never used but that were followed by used arguments. For example: function one(a, b) { return b; } In this example, since unused 'a' is followed by used 'b', JSHint assumes that this is a backwards compatibility issue or a specific API pattern and suppresses the warning. But this example, on the other hand, will generate a warning for 'b' because there is no reason to keep it around: function one(a, b) { return a; } References: Closes GH-607
- Loading branch information
Showing
3 changed files
with
68 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ function main(e, f) { | |
|
||
main(b); | ||
|
||
function foo() { | ||
function foo(err, cb) { | ||
main(); | ||
cb(); | ||
} |
5751c5e
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.
Great news! When can I expect the new release tag including this feature and - more important - when can I expect to see it in node-jshint?
5751c5e
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.
Around this Sunday: both for the lib and node-jshint.
5751c5e
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.
👏
5751c5e
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.
👍