Bug 1328795 - Enable some eslint rules that we are already passing. r?mossop
MozReview-Commit-ID: ExT4pFJdUl7
--- a/toolkit/.eslintrc.js
+++ b/toolkit/.eslintrc.js
@@ -85,28 +85,34 @@ module.exports = {
"no-empty-pattern": "error",
// No assiging to exception variable
"no-ex-assign": "error",
// No using !! where casting to boolean is already happening
"no-extra-boolean-cast": "error",
+ // Disallow unnecessary labels
+ "no-extra-label": "error",
+
// No double semicolon
"no-extra-semi": "error",
// No overwriting defined functions
"no-func-assign": "error",
// No invalid regular expresions
"no-invalid-regexp": "error",
// No odd whitespace characters
"no-irregular-whitespace": "error",
+ // Disallow the use of the __iterator__ property
+ "no-iterator": "error",
+
// No single if block inside an else block
"no-lonely-if": "error",
// No mixing spaces and tabs in indent
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
// No unnecessary spacing
"no-multi-spaces": ["error", { exceptions: { "AssignmentExpression": true, "VariableDeclarator": true, "ArrayExpression": true, "ObjectExpression": true } }],
@@ -124,16 +130,22 @@ module.exports = {
"no-obj-calls": "error",
// No octal literals
"no-octal": "error",
// No redeclaring variables
"no-redeclare": "error",
+ // Disallow multiple spaces in regular expressions
+ "no-regex-spaces": "error",
+
+ // Disallow assignments where both sides are exactly the same
+ "no-self-assign": "error",
+
// No unnecessary comparisons
"no-self-compare": "error",
// No declaring variables from an outer scope
// "no-shadow": "error",
// No declaring variables that hide things like arguments
"no-shadow-restricted-names": "error",
@@ -145,16 +157,22 @@ module.exports = {
// "no-undef": "error",
// Error on newline where a semicolon is needed
"no-unexpected-multiline": "error",
// No unreachable statements
"no-unreachable": "error",
+ // Disallow negating the left operand of relational operators
+ "no-unsafe-negation": "error",
+
+ // Disallow unused labels
+ "no-unused-labels": "error",
+
// No declaring variables that are never used
"no-unused-vars": ["error", {
"vars": "local",
"varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS",
"args": "none",
}],
// No using variables before defined