2015-11-30 10:45:45 -08: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
|
|
|
|
// "arrow-body-style": [2, "as-needed"],
|
|
|
|
|
|
|
|
// Require spacing around =>
|
|
|
|
// "arrow-spacing": 2,
|
|
|
|
|
|
|
|
// Always require spacing around a single line block
|
|
|
|
// "block-spacing": 1,
|
|
|
|
|
|
|
|
// No newline before open brace for a block
|
|
|
|
// "brace-style": 2,
|
|
|
|
|
|
|
|
// No space before always a space after a comma
|
|
|
|
// "comma-spacing": [2, {"before": false, "after": true}],
|
|
|
|
|
|
|
|
// Commas at the end of the line not the start
|
|
|
|
// "comma-style": 2,
|
|
|
|
|
|
|
|
// Don't require spaces around computed properties
|
2015-12-02 10:18:30 -08:00
|
|
|
// "computed-property-spacing": [2, "never"],
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// Functions must always return something or nothing
|
2016-02-03 13:12:18 -08:00
|
|
|
"consistent-return": 2,
|
2015-11-30 10:45:45 -08: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.
|
|
|
|
// "curly": [2, "multi-line"],
|
|
|
|
|
|
|
|
// Always require a trailing EOL
|
|
|
|
"eol-last": 2,
|
|
|
|
|
|
|
|
// Require function* name()
|
|
|
|
// "generator-star-spacing": [2, {"before": false, "after": true}],
|
|
|
|
|
|
|
|
// Two space indent
|
|
|
|
// "indent": [2, 2, { "SwitchCase": 1 }],
|
|
|
|
|
|
|
|
// Space after colon not before in property declarations
|
|
|
|
// "key-spacing": [2, { "beforeColon": false, "afterColon": true, "mode": "minimum" }],
|
|
|
|
|
|
|
|
// Unix linebreaks
|
2016-02-03 17:04:56 -08:00
|
|
|
"linebreak-style": [2, "unix"],
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// Always require parenthesis for new calls
|
|
|
|
// "new-parens": 2,
|
|
|
|
|
|
|
|
// Use [] instead of Array()
|
2015-12-02 10:18:30 -08:00
|
|
|
// "no-array-constructor": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No duplicate arguments in function declarations
|
2015-12-10 11:34:44 -08:00
|
|
|
"no-dupe-args": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No duplicate keys in object declarations
|
2015-12-10 11:34:44 -08:00
|
|
|
"no-dupe-keys": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No duplicate cases in switch statements
|
2015-12-10 11:34:44 -08:00
|
|
|
"no-duplicate-case": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No labels
|
2016-02-03 20:47:08 -08:00
|
|
|
"no-labels": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// If an if block ends with a return no need for an else block
|
|
|
|
// "no-else-return": 2,
|
|
|
|
|
|
|
|
// No empty statements
|
|
|
|
// "no-empty": 2,
|
|
|
|
|
|
|
|
// No empty character classes in regex
|
2016-02-03 17:38:13 -08:00
|
|
|
"no-empty-character-class": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// Disallow empty destructuring
|
2016-02-03 17:38:13 -08:00
|
|
|
"no-empty-pattern": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No assiging to exception variable
|
|
|
|
// "no-ex-assign": 2,
|
|
|
|
|
|
|
|
// No using !! where casting to boolean is already happening
|
2015-12-02 10:18:30 -08:00
|
|
|
// "no-extra-boolean-cast": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No double semicolon
|
2016-02-03 17:27:36 -08:00
|
|
|
"no-extra-semi": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No overwriting defined functions
|
2016-02-03 20:47:08 -08:00
|
|
|
"no-func-assign": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No invalid regular expresions
|
2016-02-03 17:38:13 -08:00
|
|
|
"no-invalid-regexp": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No odd whitespace characters
|
2016-02-03 18:09:49 -08:00
|
|
|
"no-irregular-whitespace": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No single if block inside an else block
|
2015-12-02 10:18:30 -08:00
|
|
|
// "no-lonely-if": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No mixing spaces and tabs in indent
|
2016-02-03 18:09:49 -08:00
|
|
|
"no-mixed-spaces-and-tabs": [2, "smart-tabs"],
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No unnecessary spacing
|
2015-12-30 07:12:17 -08:00
|
|
|
// "no-multi-spaces": [2, { exceptions: { "AssignmentExpression": true, "VariableDeclarator": true, "ArrayExpression": true, "ObjectExpression": true } }],
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No reassigning native JS objects
|
2016-02-03 20:47:08 -08:00
|
|
|
"no-native-reassign": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No (!foo in bar)
|
2016-02-03 20:47:08 -08:00
|
|
|
"no-negated-in-lhs": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// Nested ternary statements are confusing
|
|
|
|
// "no-nested-ternary": 2,
|
|
|
|
|
|
|
|
// Use {} instead of new Object()
|
2015-12-02 10:18:30 -08:00
|
|
|
// "no-new-object": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No Math() or JSON()
|
2015-12-10 11:34:44 -08:00
|
|
|
"no-obj-calls": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No octal literals
|
2016-02-03 18:21:30 -08:00
|
|
|
"no-octal": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No redeclaring variables
|
2016-02-03 13:12:18 -08:00
|
|
|
"no-redeclare": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No unnecessary comparisons
|
2016-02-03 18:21:30 -08:00
|
|
|
"no-self-compare": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No declaring variables from an outer scope
|
2015-12-02 10:18:30 -08:00
|
|
|
// "no-shadow": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No declaring variables that hide things like arguments
|
|
|
|
// "no-shadow-restricted-names": 2,
|
|
|
|
|
|
|
|
// No spaces between function name and parentheses
|
2015-12-02 10:18:30 -08:00
|
|
|
// "no-spaced-func": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No trailing whitespace
|
2016-02-03 14:22:33 -08:00
|
|
|
"no-trailing-spaces": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No using undeclared variables
|
|
|
|
// "no-undef": 2,
|
|
|
|
|
|
|
|
// Error on newline where a semicolon is needed
|
2016-02-03 18:21:30 -08:00
|
|
|
"no-unexpected-multiline": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No unreachable statements
|
|
|
|
// "no-unreachable": 2,
|
|
|
|
|
|
|
|
// No expressions where a statement is expected
|
|
|
|
// "no-unused-expressions": 2,
|
|
|
|
|
|
|
|
// No declaring variables that are never used
|
2015-12-02 10:18:30 -08:00
|
|
|
// "no-unused-vars": [2, {"vars": "all", "args": "none"}],
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No using variables before defined
|
2015-12-04 08:35:04 -08:00
|
|
|
// "no-use-before-define": [2, "nofunc"],
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No using with
|
2015-12-10 11:34:44 -08:00
|
|
|
"no-with": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// Always require semicolon at end of statement
|
|
|
|
// "semi": [2, "always"],
|
|
|
|
|
|
|
|
// Require space after keywords
|
|
|
|
// "space-after-keywords": 2,
|
|
|
|
|
|
|
|
// Require space before blocks
|
|
|
|
// "space-before-blocks": 2,
|
|
|
|
|
|
|
|
// Never use spaces before function parentheses
|
|
|
|
// "space-before-function-paren": [2, { "anonymous": "always", "named": "never" }],
|
|
|
|
|
|
|
|
// Require spaces before finally, catch, etc.
|
|
|
|
// "space-before-keywords": [2, "always"],
|
|
|
|
|
|
|
|
// No space padding in parentheses
|
|
|
|
// "space-in-parens": [2, "never"],
|
|
|
|
|
|
|
|
// Require spaces around operators
|
|
|
|
// "space-infix-ops": 2,
|
|
|
|
|
|
|
|
// Require spaces after return, throw and case
|
|
|
|
// "space-return-throw-case": 2,
|
|
|
|
|
|
|
|
// ++ and -- should not need spacing
|
2015-12-02 10:18:30 -08:00
|
|
|
// "space-unary-ops": [2, { "words": true, "nonwords": false }],
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// No comparisons to NaN
|
2016-02-03 18:21:30 -08:00
|
|
|
"use-isnan": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
|
|
|
|
// Only check typeof against valid results
|
2016-02-03 17:38:13 -08:00
|
|
|
"valid-typeof": 2,
|
2015-11-30 10:45:45 -08:00
|
|
|
}
|
|
|
|
}
|