Last active
August 16, 2017 17:34
-
-
Save tlhunter/94d672f8d77c180727b46a509ba94eff to your computer and use it in GitHub Desktop.
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
/** | |
* Proposing a new rule for no-unused-vars.args | |
* See http://eslint.org/docs/rules/no-unused-vars#args | |
* It would behave similar to after-used, except arguments with `error` sounding names should cause errors if ignored | |
* Configuring this manually with an array would be great | |
*/ | |
/*eslint no-unused-vars: ["error", { "args": "after-used-and-errors", "errors": ["e", "err", "error"] }]*/ | |
asyncWork((err, data) => { // e.g. args: all | |
// In this case I want eslint to error as I'm not handling my error | |
data.xyz = true; | |
callback(null, data); | |
}); | |
asyncWork((err, ignorable, data) => { | |
// Ignoring `ignorable` should be okay | |
if (err) { | |
return callback(err); | |
} | |
data.xyz = true; | |
callback(null, data); | |
}); | |
function somethingSync(ignorable, realData) { // e.g. args: after-used | |
// Here I don't want eslint to error, I need to ignore `ignorable` to get to realData | |
return realData++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
eslint/eslint#9112