Commit ffbc05af authored by Rich Trott's avatar Rich Trott
Browse files

tools: add recommended linting rules

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: https://github.com/nodejs/node/pull/5188


Reviewed-By: default avatartargos - Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: default avatarSakthipriyan Vairamani <thechargingvolcano@gmail.com>
parent ab6fe599
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment