Bug 1322954 - Replace deprecated `no-negated-in-lhs` ESLint option with `no-unsafe-negation`. r?markh draft
authorKit Cambridge <kit@yakshaving.ninja>
Sun, 11 Dec 2016 20:53:18 -0800
changeset 448762 0fba3e7b29ac0a16d9b19758005630e72568b269
parent 448761 54d333f94962ed8c98db72be1880ecf8a4fce4f8
child 539369 d7bd00c23fdef1575f37f38bc0c150552e1e5d18
push id38427
push userbmo:kcambridge@mozilla.com
push dateMon, 12 Dec 2016 21:55:26 +0000
reviewersmarkh
bugs1322954
milestone53.0a1
Bug 1322954 - Replace deprecated `no-negated-in-lhs` ESLint option with `no-unsafe-negation`. r?markh MozReview-Commit-ID: 3PnGSH0wzyi
.eslintrc.js
browser/extensions/formautofill/.eslintrc.js
security/manager/.eslintrc.js
toolkit/.eslintrc.js
toolkit/components/extensions/.eslintrc.js
toolkit/components/reader/.eslintrc.js
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -2,16 +2,19 @@
 
 module.exports = {
   // When adding items to this file please check for effects on sub-directories.
   "plugins": [
     "mozilla"
   ],
   "rules": {
     "mozilla/import-globals": "warn",
+
+    // No (!foo in bar) or (!object instanceof Class)
+    "no-unsafe-negation": "error",
   },
   "env": {
     "es6": true
   },
   "parserOptions": {
     "ecmaVersion": 8,
   },
 };
--- a/browser/extensions/formautofill/.eslintrc.js
+++ b/browser/extensions/formautofill/.eslintrc.js
@@ -145,19 +145,16 @@ module.exports = { // eslint-disable-lin
     // Disallow use of multiple spaces (sometimes used to align const values,
     // array or object items, etc.). It's hard to maintain and doesn't add that
     // much benefit.
     "no-multi-spaces": "warn",
 
     // No reassigning native JS objects
     "no-native-reassign": "error",
 
-    // No (!foo in bar)
-    "no-negated-in-lhs": "error",
-
     // Nested ternary statements are confusing
     "no-nested-ternary": "error",
 
     // Use {} instead of new Object()
     "no-new-object": "error",
 
     // No Math() or JSON()
     "no-obj-calls": "error",
--- a/security/manager/.eslintrc.js
+++ b/security/manager/.eslintrc.js
@@ -126,19 +126,16 @@ module.exports = { // eslint-disable-lin
       "VariableDeclarator": true,
       "ArrayExpression": true,
       "ObjectExpression": true
     }}],
 
     // No reassigning native JS objects
     "no-native-reassign": "error",
 
-    // No (!foo in bar)
-    "no-negated-in-lhs": "error",
-
     // Nested ternary statements are confusing
     "no-nested-ternary": "error",
 
     // Use {} instead of new Object()
     "no-new-object": "error",
 
     // No Math() or JSON()
     "no-obj-calls": "error",
--- a/toolkit/.eslintrc.js
+++ b/toolkit/.eslintrc.js
@@ -109,19 +109,16 @@ module.exports = {
     "no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
 
     // No unnecessary spacing
     // "no-multi-spaces": ["error", { exceptions: { "AssignmentExpression": true, "VariableDeclarator": true, "ArrayExpression": true, "ObjectExpression": true } }],
 
     // No reassigning native JS objects
     "no-native-reassign": "error",
 
-    // No (!foo in bar)
-    "no-negated-in-lhs": "error",
-
     // Nested ternary statements are confusing
     "no-nested-ternary": "error",
 
     // Use {} instead of new Object()
     "no-new-object": "error",
 
     // No Math() or JSON()
     "no-obj-calls": "error",
--- a/toolkit/components/extensions/.eslintrc.js
+++ b/toolkit/components/extensions/.eslintrc.js
@@ -164,19 +164,16 @@ module.exports = { // eslint-disable-lin
     // Disallow use of multiple spaces (sometimes used to align const values,
     // array or object items, etc.). It's hard to maintain and doesn't add that
     // much benefit.
     "no-multi-spaces": "warn",
 
     // No reassigning native JS objects
     "no-native-reassign": "error",
 
-    // No (!foo in bar)
-    "no-negated-in-lhs": "error",
-
     // Nested ternary statements are confusing
     "no-nested-ternary": "error",
 
     // Use {} instead of new Object()
     "no-new-object": "error",
 
     // No Math() or JSON()
     "no-obj-calls": "error",
--- a/toolkit/components/reader/.eslintrc.js
+++ b/toolkit/components/reader/.eslintrc.js
@@ -104,19 +104,16 @@ module.exports = {
     "no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
 
     // No unnecessary spacing
     "no-multi-spaces": ["error", { exceptions: { "AssignmentExpression": true, "VariableDeclarator": true, "ArrayExpression": true, "ObjectExpression": true } }],
 
     // No reassigning native JS objects
     "no-native-reassign": "error",
 
-    // No (!foo in bar)
-    "no-negated-in-lhs": "error",
-
     // Nested ternary statements are confusing
     "no-nested-ternary": "error",
 
     // Use {} instead of new Object()
     // "no-new-object": "error",
 
     // No Math() or JSON()
     "no-obj-calls": "error",