From 096508dfa97c6b10ed16db1f20da0cbe6ef808b0 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 16 Apr 2017 11:29:35 -0700 Subject: 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 Reviewed-By: Anna Henningsen Reviewed-By: Gibson Fahnestock Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- .eslintrc.yaml | 1 + 1 file changed, 1 insertion(+) (limited to '.eslintrc.yaml') 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 -- cgit v1.2.1