diff options
author | Rich Trott <rtrott@gmail.com> | 2017-04-16 11:29:35 -0700 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-04-18 08:20:24 -0700 |
commit | 096508dfa97c6b10ed16db1f20da0cbe6ef808b0 (patch) | |
tree | 83e2fe2063656c9f74665cc3a213617b0d4db373 /.eslintrc.yaml | |
parent | 2e5188de928946c81266b149887d9b31111a5267 (diff) | |
download | node-new-096508dfa97c6b10ed16db1f20da0cbe6ef808b0.tar.gz |
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: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to '.eslintrc.yaml')
-rw-r--r-- | .eslintrc.yaml | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 7468a23438..e4df6e6e4f 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -34,6 +34,7 @@ rules: # Best Practices # http://eslint.org/docs/rules/#best-practices dot-location: [2, property] + eqeqeq: [2, smart] no-fallthrough: 2 no-global-assign: 2 no-multi-spaces: 2 |