Commit 096508df authored by Rich Trott's avatar Rich Trott Committed by James M Snell
Browse files

tools,lib: enable strict equality lint rule

Enablie a lint rule to require `===` and `!==` instead of `==` and `!=`
except in some well-defined cases:

* comparing against `null` as a shorthand for also checking for
  `undefined`
* comparing the result of `typeof`
* comparing literal values

In cases where `==` or `!=` are being used as optimizations, use an
ESLint comment to disable the `eqeqeq` rule for that line explicitly. I
rather like this because it's a signal that the usage is intentional and
not a mistake.

PR-URL: https://github.com/nodejs/node/pull/12446


Reviewed-By: default avatarBenjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
Reviewed-By: default avatarGibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: default avatarLuigi Pinca <luigipinca@gmail.com>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
parent 2e5188de
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