Uh oh!
There was an error while loading. Please reload this page.
tools: add recommended linting rules - #5188
Conversation
Trott
commented
Feb 10, 2016
thefourtheye
commented
Feb 11, 2016
LGTM but regarding |
Trott
commented
Feb 11, 2016
@thefourtheye I may be misunderstanding, but I don't think that would work: Anything (including |
thefourtheye
commented
Feb 11, 2016
|
silverwind
commented
Feb 11, 2016
|
Trott
commented
Feb 11, 2016
@thefourtheye wrote:
Ah! I see! Well, fortunately, the linting rule won't flag that. So everybody wins! |
targos
commented
Feb 11, 2016
@thefourtheye |
targos
commented
Feb 11, 2016
LGTM. Can you also add a line about |
thefourtheye
commented
Feb 11, 2016
@targos I understand that. I was actually referring to the performance drop mentioned in #1925 |
This change adds ESLint rules that meet two criteria: * recommended by ESLint * require no code changes These rules are: * `no-func-assign`: Disallow overwriting a function that was written as a function declaration. * `no-negated-in-lhs`: Disallow negated left operand of `in` operator. It prevents `if(!a in b)` when `if(!(a in b))` is intended. * `no-obj-calls`: Disallow global object function calls. It prevents errors like `JSON()` and `Math()`. to exercise the code in tests or whatever, it can sneak in. * `use-isnan`: Prevents errors like `if (foo == NaN)` * `no-octal`: Disallows confusing constructs like `var num = 071;` * `no-delete-var`: Delete works on properties, not variables. Disallows `delete foo`.
Trott
commented
Feb 11, 2016
@targos Whoops, missed that one! I've updated the commit message. |
This change adds ESLint rules that meet two criteria: * recommended by ESLint * require no code changes These rules are: * `no-func-assign`: Disallow overwriting a function that was written as a function declaration. * `no-negated-in-lhs`: Disallow negated left operand of `in` operator. It prevents `if(!a in b)` when `if(!(a in b))` is intended. * `no-obj-calls`: Disallow global object function calls. It prevents errors like `JSON()` and `Math()`. to exercise the code in tests or whatever, it can sneak in. * `use-isnan`: Prevents errors like `if (foo == NaN)` * `no-octal`: Disallows confusing constructs like `var num = 071;` * `no-delete-var`: Delete works on properties, not variables. Disallows `delete foo`. PR-URL: #5188 Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Trott
commented
Feb 12, 2016
Landed in ffbc05a |
This change adds ESLint rules that meet two criteria: * recommended by ESLint * require no code changes These rules are: * `no-func-assign`: Disallow overwriting a function that was written as a function declaration. * `no-negated-in-lhs`: Disallow negated left operand of `in` operator. It prevents `if(!a in b)` when `if(!(a in b))` is intended. * `no-obj-calls`: Disallow global object function calls. It prevents errors like `JSON()` and `Math()`. to exercise the code in tests or whatever, it can sneak in. * `use-isnan`: Prevents errors like `if (foo == NaN)` * `no-octal`: Disallows confusing constructs like `var num = 071;` * `no-delete-var`: Delete works on properties, not variables. Disallows `delete foo`. PR-URL: #5188 Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
This change adds ESLint rules that meet two criteria: * recommended by ESLint * require no code changes These rules are: * `no-func-assign`: Disallow overwriting a function that was written as a function declaration. * `no-negated-in-lhs`: Disallow negated left operand of `in` operator. It prevents `if(!a in b)` when `if(!(a in b))` is intended. * `no-obj-calls`: Disallow global object function calls. It prevents errors like `JSON()` and `Math()`. to exercise the code in tests or whatever, it can sneak in. * `use-isnan`: Prevents errors like `if (foo == NaN)` * `no-octal`: Disallows confusing constructs like `var num = 071;` * `no-delete-var`: Delete works on properties, not variables. Disallows `delete foo`. PR-URL: #5188 Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
This change adds ESLint rules that meet two criteria: * recommended by ESLint * require no code changes These rules are: * `no-func-assign`: Disallow overwriting a function that was written as a function declaration. * `no-negated-in-lhs`: Disallow negated left operand of `in` operator. It prevents `if(!a in b)` when `if(!(a in b))` is intended. * `no-obj-calls`: Disallow global object function calls. It prevents errors like `JSON()` and `Math()`. to exercise the code in tests or whatever, it can sneak in. * `use-isnan`: Prevents errors like `if (foo == NaN)` * `no-octal`: Disallows confusing constructs like `var num = 071;` * `no-delete-var`: Delete works on properties, not variables. Disallows `delete foo`. PR-URL: #5188 Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
This change adds ESLint rules that meet two criteria: * recommended by ESLint * require no code changes These rules are: * `no-func-assign`: Disallow overwriting a function that was written as a function declaration. * `no-negated-in-lhs`: Disallow negated left operand of `in` operator. It prevents `if(!a in b)` when `if(!(a in b))` is intended. * `no-obj-calls`: Disallow global object function calls. It prevents errors like `JSON()` and `Math()`. to exercise the code in tests or whatever, it can sneak in. * `use-isnan`: Prevents errors like `if (foo == NaN)` * `no-octal`: Disallows confusing constructs like `var num = 071;` * `no-delete-var`: Delete works on properties, not variables. Disallows `delete foo`. PR-URL: nodejs#5188 Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
This change adds ESLint rules that meet two criteria: * recommended by ESLint * require no code changes These rules are: * `no-func-assign`: Disallow overwriting a function that was written as a function declaration. * `no-negated-in-lhs`: Disallow negated left operand of `in` operator. It prevents `if(!a in b)` when `if(!(a in b))` is intended. * `no-obj-calls`: Disallow global object function calls. It prevents errors like `JSON()` and `Math()`. to exercise the code in tests or whatever, it can sneak in. * `use-isnan`: Prevents errors like `if (foo == NaN)` * `no-octal`: Disallows confusing constructs like `var num = 071;` * `no-delete-var`: Delete works on properties, not variables. Disallows `delete foo`. PR-URL: #5188 Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
This change adds ESLint rules that meet two criteria:
These rules are:
no-func-assign: Disallow overwriting a function that was writtenas a function declaration.
no-negated-in-lhs: Disallow negated left operand ofinoperator.It prevents
if(!a in b)whenif(!(a in b))is intended.no-obj-calls: Disallow global object function calls. It preventserrors like
JSON()andMath().use-isnan: Prevents errors likeif (foo == NaN)no-octal: Disallows confusing constructs likevar num = 071;no-delete-var: Delete works on properties, not variables. Disallowsdelete foo.This may make configuration much more concise if we turn on recommended rules and then disable ones that we aren't using.
And it may prevent some errors from making it into the PR stage and requiring a reviewer to correct.