Bug 1338075 - formautofill: Inherit all eslint rules where off is currently specified. r=lchang

MozReview-Commit-ID: HHAzuSHMwju

--HG--
rename : browser/extensions/formautofill/test/unit/.eslintrc => browser/extensions/formautofill/test/unit/.eslintrc.js
extra : rebase_source : 02e90deb19978704c3fa1d94e1ae0a910c9d33e9
This commit is contained in:
Matthew Noorenberghe 2017-02-10 15:12:32 +08:00
Родитель dfc778070c
Коммит 86efce1f15
3 изменённых файлов: 10 добавлений и 126 удалений

Просмотреть файл

@ -115,188 +115,70 @@ module.exports = { // eslint-disable-line no-undef
// with auto-binding fat arrow functions). // with auto-binding fat arrow functions).
// "consistent-this": ["error", "self"], // "consistent-this": ["error", "self"],
// Don't require a default case in switch statements. Avoid being forced to
// add a bogus default when you know all possible cases are handled.
"default-case": "off",
// Enforce dots on the next line with property name. // Enforce dots on the next line with property name.
"dot-location": ["error", "property"], "dot-location": ["error", "property"],
// Encourage the use of dot notation whenever possible. // Encourage the use of dot notation whenever possible.
"dot-notation": "error", "dot-notation": "error",
// Allow using == instead of ===, in the interest of landing something since
// the devtools codebase is split on convention here.
"eqeqeq": "off",
// Don't require function expressions to have a name.
// This makes the code more verbose and hard to read. Our engine already
// does a fantastic job assigning a name to the function, which includes
// the enclosing function name, and worst case you have a line number that
// you can just look up.
"func-names": "off",
// Allow use of function declarations and expressions.
"func-style": "off",
// Don't enforce the maximum depth that blocks can be nested. The complexity
// rule is a better rule to check this.
"max-depth": "off",
// Maximum length of a line. // Maximum length of a line.
// Disabled because we exceed this in too many places. // This should be 100 but too many lines were longer than that so set a
"max-len": ["off", 80], // conservative upper bound for now.
"max-len": ["error", 140],
// Maximum depth callbacks can be nested. // Maximum depth callbacks can be nested.
"max-nested-callbacks": ["error", 4], "max-nested-callbacks": ["error", 4],
// Don't limit the number of parameters that can be used in a function.
"max-params": "off",
// Don't limit the maximum number of statement allowed in a function. We
// already have the complexity rule that's a better measurement.
"max-statements": "off",
// Don't require a capital letter for constructors, only check if all new
// operators are followed by a capital letter. Don't warn when capitalized
// functions are used without the new operator.
"new-cap": ["off", {"capIsNew": false}],
// Allow use of bitwise operators.
"no-bitwise": "off",
// Disallow use of arguments.caller or arguments.callee. // Disallow use of arguments.caller or arguments.callee.
"no-caller": "error", "no-caller": "error",
// Disallow the catch clause parameter name being the same as a variable in
// the outer scope, to avoid confusion.
"no-catch-shadow": "off",
// Disallow using the console API. // Disallow using the console API.
"no-console": "error", "no-console": "error",
// Allow using constant expressions in conditions like while (true)
"no-constant-condition": "off",
// Allow use of the continue statement.
"no-continue": "off",
// Disallow control characters in regular expressions. // Disallow control characters in regular expressions.
"no-control-regex": "error", "no-control-regex": "error",
// Allow division operators explicitly at beginning of regular expression.
"no-div-regex": "off",
// Disallow use of eval(). We have other APIs to evaluate code in content. // Disallow use of eval(). We have other APIs to evaluate code in content.
"no-eval": "error", "no-eval": "error",
// Disallow adding to native types // Disallow adding to native types
"no-extend-native": "error", "no-extend-native": "error",
// Allow unnecessary parentheses, as they may make the code more readable.
"no-extra-parens": "off",
// Disallow fallthrough of case statements, except if there is a comment. // Disallow fallthrough of case statements, except if there is a comment.
"no-fallthrough": "error", "no-fallthrough": "error",
// Allow the use of leading or trailing decimal points in numeric literals.
"no-floating-decimal": "off",
// Allow comments inline after code.
"no-inline-comments": "off",
// Disallow use of multiline strings (use template strings instead). // Disallow use of multiline strings (use template strings instead).
"no-multi-str": "warn", "no-multi-str": "warn",
// Disallow multiple empty lines. // Disallow multiple empty lines.
"no-multiple-empty-lines": ["warn", {"max": 2}], "no-multiple-empty-lines": ["warn", {"max": 2}],
// Allow reassignment of function parameters.
"no-param-reassign": "off",
// Allow string concatenation with __dirname and __filename (not a node env).
"no-path-concat": "off",
// Allow use of unary operators, ++ and --.
"no-plusplus": "off",
// Allow using process.env (not a node environment).
"no-process-env": "off",
// Allow using process.exit (not a node environment).
"no-process-exit": "off",
// Disallow usage of __proto__ property. // Disallow usage of __proto__ property.
"no-proto": "error", "no-proto": "error",
// Allow reserved words being used as object literal keys.
"no-reserved-keys": "off",
// Don't restrict usage of specified node modules (not a node environment).
"no-restricted-modules": "off",
// Disallow use of assignment in return statement. It is preferable for a // Disallow use of assignment in return statement. It is preferable for a
// single line of code to have only one easily predictable effect. // single line of code to have only one easily predictable effect.
"no-return-assign": "error", "no-return-assign": "error",
// Allow use of synchronous methods (not a node environment).
"no-sync": "off",
// Allow the use of ternary operators.
"no-ternary": "off",
// Disallow throwing literals (eg. throw "error" instead of // Disallow throwing literals (eg. throw "error" instead of
// throw new Error("error")). // throw new Error("error")).
"no-throw-literal": "error", "no-throw-literal": "error",
// Allow dangling underscores in identifiers (for privates).
"no-underscore-dangle": "off",
// Allow use of undefined variable.
"no-undefined": "off",
// Disallow the use of Boolean literals in conditional expressions. // Disallow the use of Boolean literals in conditional expressions.
"no-unneeded-ternary": "error", "no-unneeded-ternary": "error",
// We use var-only-at-top-level instead of no-var as we allow top level
// vars.
"no-var": "off",
// Allow using TODO/FIXME comments.
"no-warning-comments": "off",
// Allow more than one variable declaration per function.
"one-var": "off",
// Disallow padding within blocks. // Disallow padding within blocks.
"padded-blocks": ["warn", "never"], "padded-blocks": ["warn", "never"],
// Don't require quotes around object literal property names.
"quote-props": "off",
// Require use of the second argument for parseInt(). // Require use of the second argument for parseInt().
"radix": "error", "radix": "error",
// Enforce spacing after semicolons. // Enforce spacing after semicolons.
"semi-spacing": ["error", {"before": false, "after": true}], "semi-spacing": ["error", {"before": false, "after": true}],
// Don't require to sort variables within the same declaration block.
// Anyway, one-var is disabled.
"sort-vars": "off",
// Require "use strict" to be defined globally in the script. // Require "use strict" to be defined globally in the script.
"strict": ["error", "global"], "strict": ["error", "global"],
// Allow vars to be declared anywhere in the scope.
"vars-on-top": "off",
// Don't require immediate function invocation to be wrapped in parentheses.
"wrap-iife": "off",
// Don't require regex literals to be wrapped in parentheses (which
// supposedly prevent them from being mistaken for division operators).
"wrap-regex": "off",
// Disallow Yoda conditions (where literal value comes first). // Disallow Yoda conditions (where literal value comes first).
"yoda": "error", "yoda": "error",

Просмотреть файл

@ -1,5 +0,0 @@
{
"extends": [
"../../../../../testing/xpcshell/xpcshell.eslintrc.js"
],
}

Просмотреть файл

@ -0,0 +1,7 @@
"use strict";
module.exports = { // eslint-disable-line no-undef
"extends": [
"../../../../../testing/xpcshell/xpcshell.eslintrc.js",
],
};