2016-10-18 10:38:10 +03:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
module.exports = {
|
2015-11-30 21:45:45 +03:00
|
|
|
// When adding items to this file please check for effects on all of toolkit
|
|
|
|
// and browser
|
|
|
|
"rules": {
|
|
|
|
// Braces only needed for multi-line arrow function blocks
|
2016-11-08 23:14:19 +03:00
|
|
|
// "arrow-body-style": ["error", "as-needed"],
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// Require spacing around =>
|
2016-11-08 23:14:19 +03:00
|
|
|
"arrow-spacing": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// Always require spacing around a single line block
|
2016-11-08 23:14:19 +03:00
|
|
|
"block-spacing": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No newline before open brace for a block
|
2016-11-08 23:14:19 +03:00
|
|
|
// "brace-style": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No space before always a space after a comma
|
2016-11-08 23:14:19 +03:00
|
|
|
"comma-spacing": ["error", {"before": false, "after": true}],
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// Commas at the end of the line not the start
|
2016-11-08 23:14:19 +03:00
|
|
|
// "comma-style": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// Don't require spaces around computed properties
|
2016-11-08 23:14:19 +03:00
|
|
|
"computed-property-spacing": ["error", "never"],
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// Functions must always return something or nothing
|
2016-11-08 23:14:19 +03:00
|
|
|
"consistent-return": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// Require braces around blocks that start a new line
|
|
|
|
// Note that this rule is likely to be overridden on a per-directory basis
|
|
|
|
// very frequently.
|
2016-11-08 23:14:19 +03:00
|
|
|
// "curly": ["error", "multi-line"],
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// Always require a trailing EOL
|
2016-11-08 23:14:19 +03:00
|
|
|
"eol-last": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
2016-11-11 02:05:32 +03:00
|
|
|
// No spaces between function name and parentheses
|
|
|
|
"func-call-spacing": "error",
|
|
|
|
|
2015-11-30 21:45:45 +03:00
|
|
|
// Require function* name()
|
2016-11-08 23:14:19 +03:00
|
|
|
// "generator-star-spacing": ["error", {"before": false, "after": true}],
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// Two space indent
|
2016-11-08 23:14:19 +03:00
|
|
|
// "indent": ["error", 2, { "SwitchCase": 1 }],
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// Space after colon not before in property declarations
|
2016-11-08 23:14:19 +03:00
|
|
|
// "key-spacing": ["error", { "beforeColon": false, "afterColon": true, "mode": "minimum" }],
|
2015-11-30 21:45:45 +03:00
|
|
|
|
2016-04-05 21:33:12 +03:00
|
|
|
// Require spaces before and after keywords
|
2016-11-08 23:14:19 +03:00
|
|
|
"keyword-spacing": "error",
|
2016-04-05 21:33:12 +03:00
|
|
|
|
2015-11-30 21:45:45 +03:00
|
|
|
// Unix linebreaks
|
2016-11-08 23:14:19 +03:00
|
|
|
"linebreak-style": ["error", "unix"],
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// Always require parenthesis for new calls
|
2016-11-08 23:14:19 +03:00
|
|
|
// "new-parens": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// Use [] instead of Array()
|
2016-11-08 23:14:19 +03:00
|
|
|
// "no-array-constructor": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No duplicate arguments in function declarations
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-dupe-args": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No duplicate keys in object declarations
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-dupe-keys": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No duplicate cases in switch statements
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-duplicate-case": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No labels
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-labels": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// If an if block ends with a return no need for an else block
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-else-return": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No empty statements
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-empty": ["error", {"allowEmptyCatch": true}],
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No empty character classes in regex
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-empty-character-class": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// Disallow empty destructuring
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-empty-pattern": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No assiging to exception variable
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-ex-assign": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No using !! where casting to boolean is already happening
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-extra-boolean-cast": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No double semicolon
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-extra-semi": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No overwriting defined functions
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-func-assign": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No invalid regular expresions
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-invalid-regexp": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No odd whitespace characters
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-irregular-whitespace": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No single if block inside an else block
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-lonely-if": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No mixing spaces and tabs in indent
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No unnecessary spacing
|
2016-11-08 23:14:19 +03:00
|
|
|
// "no-multi-spaces": ["error", { exceptions: { "AssignmentExpression": true, "VariableDeclarator": true, "ArrayExpression": true, "ObjectExpression": true } }],
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No reassigning native JS objects
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-native-reassign": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No (!foo in bar)
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-negated-in-lhs": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// Nested ternary statements are confusing
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-nested-ternary": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// Use {} instead of new Object()
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-new-object": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No Math() or JSON()
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-obj-calls": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No octal literals
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-octal": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No redeclaring variables
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-redeclare": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No unnecessary comparisons
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-self-compare": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No declaring variables from an outer scope
|
2016-11-08 23:14:19 +03:00
|
|
|
// "no-shadow": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No declaring variables that hide things like arguments
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-shadow-restricted-names": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No trailing whitespace
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-trailing-spaces": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No using undeclared variables
|
2016-11-08 23:14:19 +03:00
|
|
|
// "no-undef": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// Error on newline where a semicolon is needed
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-unexpected-multiline": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No unreachable statements
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-unreachable": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No declaring variables that are never used
|
2016-11-08 15:49:32 +03:00
|
|
|
// "no-unused-vars": ["error", {
|
|
|
|
// "vars": "local",
|
|
|
|
// "varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS",
|
|
|
|
// "args": "none",
|
|
|
|
// }],
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No using variables before defined
|
2016-11-08 23:14:19 +03:00
|
|
|
// "no-use-before-define": ["error", "nofunc"],
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No using with
|
2016-11-08 23:14:19 +03:00
|
|
|
"no-with": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
2016-11-11 02:12:47 +03:00
|
|
|
// No spacing inside rest or spread expressions
|
|
|
|
"rest-spread-spacing": "error",
|
|
|
|
|
2015-11-30 21:45:45 +03:00
|
|
|
// Always require semicolon at end of statement
|
2016-11-08 23:14:19 +03:00
|
|
|
// "semi": ["error", "always"],
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// Require space before blocks
|
2016-11-08 23:14:19 +03:00
|
|
|
"space-before-blocks": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// Never use spaces before function parentheses
|
2016-11-08 23:14:19 +03:00
|
|
|
// "space-before-function-paren": ["error", { "anonymous": "always", "named": "never" }],
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// No space padding in parentheses
|
2016-11-08 23:14:19 +03:00
|
|
|
// "space-in-parens": ["error", "never"],
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// Require spaces around operators
|
2016-11-11 01:48:04 +03:00
|
|
|
"space-infix-ops": ["error", { "int32Hint": true }],
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// ++ and -- should not need spacing
|
2016-11-08 23:14:19 +03:00
|
|
|
// "space-unary-ops": ["error", { "words": true, "nonwords": false }],
|
2015-11-30 21:45:45 +03:00
|
|
|
|
2016-10-24 20:14:19 +03:00
|
|
|
// Requires or disallows a whitespace (space or tab) beginning a comment
|
2016-11-08 23:14:19 +03:00
|
|
|
"spaced-comment": "error",
|
2016-10-24 20:14:19 +03:00
|
|
|
|
2015-11-30 21:45:45 +03:00
|
|
|
// No comparisons to NaN
|
2016-11-08 23:14:19 +03:00
|
|
|
"use-isnan": "error",
|
2015-11-30 21:45:45 +03:00
|
|
|
|
|
|
|
// Only check typeof against valid results
|
2016-11-08 23:14:19 +03:00
|
|
|
"valid-typeof": "error",
|
2016-02-05 23:12:30 +03:00
|
|
|
},
|
|
|
|
"env": {
|
|
|
|
"es6": true,
|
|
|
|
"browser": true,
|
|
|
|
},
|
|
|
|
"globals": {
|
|
|
|
"Components": false,
|
|
|
|
"dump": true,
|
|
|
|
"openDialog": false,
|
|
|
|
"sizeToContent": false,
|
2015-11-30 21:45:45 +03:00
|
|
|
}
|
2016-10-18 10:38:10 +03:00
|
|
|
};
|