Bug 1322954 - Replace deprecated `no-negated-in-lhs` ESLint option with `no-unsafe-negation`. r?markh
MozReview-Commit-ID: 3PnGSH0wzyi
--- 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",