eslint: Convert 2 to error in config.

This commit is contained in:
Thomas Ip 2019-06-22 14:00:15 +08:00 committed by Tim Abbott
parent 9f916f78da
commit 71caf114fb
1 changed files with 91 additions and 91 deletions

View File

@ -223,7 +223,7 @@
"array-callback-return": "error", "array-callback-return": "error",
"array-bracket-spacing": "error", "array-bracket-spacing": "error",
"arrow-spacing": [ "error", { "before": true, "after": true } ], "arrow-spacing": [ "error", { "before": true, "after": true } ],
"block-scoped-var": 2, "block-scoped-var": "error",
"brace-style": [ "error", "1tbs", { "allowSingleLine": true } ], "brace-style": [ "error", "1tbs", { "allowSingleLine": true } ],
"camelcase": 0, "camelcase": 0,
"comma-dangle": [ "error", "comma-dangle": [ "error",
@ -242,13 +242,13 @@
} }
], ],
"complexity": [ 0, 4 ], "complexity": [ 0, 4 ],
"curly": 2, "curly": "error",
"dot-notation": [ "error", { "allowKeywords": true } ], "dot-notation": [ "error", { "allowKeywords": true } ],
"empty-returns/main": "error", "empty-returns/main": "error",
"eol-last": [ "error", "always" ], "eol-last": [ "error", "always" ],
"eqeqeq": 2, "eqeqeq": "error",
"func-style": [ "off", "expression" ], "func-style": [ "off", "expression" ],
"guard-for-in": 2, "guard-for-in": "error",
"indent": ["error", 4, { "indent": ["error", 4, {
"ArrayExpression": "first", "ArrayExpression": "first",
"outerIIFEBody": 0, "outerIIFEBody": 0,
@ -293,68 +293,68 @@
"capIsNew": false "capIsNew": false
} }
], ],
"new-parens": 2, "new-parens": "error",
"newline-per-chained-call": 0, "newline-per-chained-call": 0,
"no-alert": 2, "no-alert": "error",
"no-array-constructor": "error", "no-array-constructor": "error",
"no-bitwise": 2, "no-bitwise": "error",
"no-caller": 2, "no-caller": "error",
"no-case-declarations": "error", "no-case-declarations": "error",
"no-catch-shadow": 2, "no-catch-shadow": "error",
"no-console": 0, "no-console": 0,
"no-const-assign": "error", "no-const-assign": "error",
"no-control-regex": 2, "no-control-regex": "error",
"no-debugger": 2, "no-debugger": "error",
"no-delete-var": 2, "no-delete-var": "error",
"no-div-regex": 2, "no-div-regex": "error",
"no-dupe-class-members": "error", "no-dupe-class-members": "error",
"no-dupe-keys": 2, "no-dupe-keys": "error",
"no-duplicate-imports": "error", "no-duplicate-imports": "error",
"no-else-return": 2, "no-else-return": "error",
"no-empty": 2, "no-empty": "error",
"no-empty-character-class": 2, "no-empty-character-class": "error",
"no-eq-null": 2, "no-eq-null": "error",
"no-eval": 2, "no-eval": "error",
"no-ex-assign": 2, "no-ex-assign": "error",
"no-extra-parens": ["error", "all"], "no-extra-parens": ["error", "all"],
"no-extra-semi": 2, "no-extra-semi": "error",
"no-fallthrough": 2, "no-fallthrough": "error",
"no-floating-decimal": 2, "no-floating-decimal": "error",
"no-func-assign": 2, "no-func-assign": "error",
"no-implied-eval": 2, "no-implied-eval": "error",
"no-iterator": "error", "no-iterator": "error",
"no-label-var": 2, "no-label-var": "error",
"no-labels": 2, "no-labels": "error",
"no-loop-func": 2, "no-loop-func": "error",
"no-mixed-requires": [ 0, false ], "no-mixed-requires": [ 0, false ],
"no-multi-str": 2, "no-multi-str": "error",
"no-native-reassign": 2, "no-native-reassign": "error",
"no-nested-ternary": 0, "no-nested-ternary": 0,
"no-new-func": "error", "no-new-func": "error",
"no-new-object": 2, "no-new-object": "error",
"no-new-wrappers": 2, "no-new-wrappers": "error",
"no-obj-calls": 2, "no-obj-calls": "error",
"no-octal": 2, "no-octal": "error",
"no-octal-escape": 2, "no-octal-escape": "error",
"no-param-reassign": 0, "no-param-reassign": 0,
"no-plusplus": 2, "no-plusplus": "error",
"no-proto": 2, "no-proto": "error",
"no-redeclare": 2, "no-redeclare": "error",
"no-regex-spaces": 2, "no-regex-spaces": "error",
"no-restricted-syntax": 0, "no-restricted-syntax": 0,
"no-return-assign": 2, "no-return-assign": "error",
"no-script-url": 2, "no-script-url": "error",
"no-self-compare": 2, "no-self-compare": "error",
"no-shadow": 0, "no-shadow": 0,
"no-sync": 2, "no-sync": "error",
"no-ternary": 0, "no-ternary": 0,
"no-trailing-spaces": 2, "no-trailing-spaces": "error",
"no-undef": "error", "no-undef": "error",
"no-undef-init": 2, "no-undef-init": "error",
"no-underscore-dangle": 0, "no-underscore-dangle": 0,
"no-unneeded-ternary": [ "error", { "defaultAssignment": false } ], "no-unneeded-ternary": [ "error", { "defaultAssignment": false } ],
"no-unreachable": 2, "no-unreachable": "error",
"no-unused-expressions": 2, "no-unused-expressions": "error",
"no-unused-vars": [ "error", "no-unused-vars": [ "error",
{ {
"vars": "local", "vars": "local",
@ -362,16 +362,16 @@
"varsIgnorePattern": "print_elapsed_time|check_duplicate_ids" "varsIgnorePattern": "print_elapsed_time|check_duplicate_ids"
} }
], ],
"no-use-before-define": 2, "no-use-before-define": "error",
"no-useless-constructor": "error", "no-useless-constructor": "error",
// The Zulip codebase complies partially with the "no-useless-escape" // The Zulip codebase complies partially with the "no-useless-escape"
// rule; only regex expressions haven't been updated yet. // rule; only regex expressions haven't been updated yet.
// Updated regex expressions are currently being tested in casper // Updated regex expressions are currently being tested in casper
// files and will decide about a potential future enforcement of this rule. // files and will decide about a potential future enforcement of this rule.
"no-useless-escape": 0, "no-useless-escape": 0,
"space-unary-ops": 2, "space-unary-ops": "error",
"no-whitespace-before-property": 2, "no-whitespace-before-property": "error",
"no-with": 2, "no-with": "error",
"one-var": [ "error", "never" ], "one-var": [ "error", "never" ],
"padded-blocks": 0, "padded-blocks": 0,
"prefer-const": [ "error", "prefer-const": [ "error",
@ -388,10 +388,10 @@
} }
], ],
"quotes": [ 0, "single" ], "quotes": [ 0, "single" ],
"radix": 2, "radix": "error",
"semi": 2, "semi": "error",
"semi-spacing": [2, {"before": false, "after": true}], "semi-spacing": ["error", {"before": false, "after": true}],
"space-before-blocks": 2, "space-before-blocks": "error",
"space-before-function-paren": [ "error", "space-before-function-paren": [ "error",
{ {
"anonymous": "always", "anonymous": "always",
@ -399,17 +399,17 @@
"asyncArrow": "always" "asyncArrow": "always"
} }
], ],
"space-in-parens": 2, "space-in-parens": "error",
"space-infix-ops": 2, "space-infix-ops": "error",
"spaced-comment": 0, "spaced-comment": 0,
"strict": 0, "strict": 0,
"template-curly-spacing": "error", "template-curly-spacing": "error",
"unnecessary-strict": 0, "unnecessary-strict": 0,
"use-isnan": 2, "use-isnan": "error",
"valid-typeof": [ "error", { "requireStringLiterals": true } ], "valid-typeof": [ "error", { "requireStringLiterals": true } ],
"wrap-iife": [ "error", "outside", { "functionPrototypeMethods": false } ], "wrap-iife": [ "error", "outside", { "functionPrototypeMethods": false } ],
"wrap-regex": 0, "wrap-regex": 0,
"yoda": 2 "yoda": "error"
}, },
"overrides": [ "overrides": [
{ {
@ -428,58 +428,58 @@
"semi": 0, "semi": 0,
"no-unused-vars": 0, "no-unused-vars": 0,
"@typescript-eslint/adjacent-overload-signatures": 2, "@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": 2, "@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": 2, "@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-types": 2, "@typescript-eslint/ban-types": "error",
"@typescript-eslint/ban-ts-ignore": 0, "@typescript-eslint/ban-ts-ignore": 0,
"@typescript-eslint/camelcase": 0, "@typescript-eslint/camelcase": 0,
"@typescript-eslint/class-name-casing": 2, "@typescript-eslint/class-name-casing": "error",
"@typescript-eslint/explicit-function-return-type": ["error", { "allowExpressions": true }], "@typescript-eslint/explicit-function-return-type": ["error", { "allowExpressions": true }],
"@typescript-eslint/explicit-member-accessibility": 0, "@typescript-eslint/explicit-member-accessibility": 0,
"@typescript-eslint/func-call-spacing": 2, "@typescript-eslint/func-call-spacing": "error",
"@typescript-eslint/generic-type-naming": 0, "@typescript-eslint/generic-type-naming": 0,
"@typescript-eslint/indent": 2, "@typescript-eslint/indent": "error",
"@typescript-eslint/interface-name-prefix": 0, "@typescript-eslint/interface-name-prefix": 0,
"@typescript-eslint/member-delimiter-style": 2, "@typescript-eslint/member-delimiter-style": "error",
"@typescript-eslint/member-naming": ["error", { "private": "^_" } ], "@typescript-eslint/member-naming": ["error", { "private": "^_" } ],
"@typescript-eslint/member-ordering": 2, "@typescript-eslint/member-ordering": "error",
"@typescript-eslint/no-angle-bracket-type-assertion": 2, "@typescript-eslint/no-angle-bracket-type-assertion": "error",
"@typescript-eslint/no-array-constructor": 2, "@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-interface": 2, "@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": 0, "@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-extraneous-class": 2, "@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-for-in-array": 0, "@typescript-eslint/no-for-in-array": 0,
"@typescript-eslint/no-inferrable-types": 2, "@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-magic-numbers": 2, "@typescript-eslint/no-magic-numbers": "error",
"@typescript-eslint/no-misused-new": 2, "@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": 2, "@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": 0, "@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/no-object-literal-type-assertion": 2, "@typescript-eslint/no-object-literal-type-assertion": "error",
"@typescript-eslint/no-parameter-properties": 2, "@typescript-eslint/no-parameter-properties": "error",
"@typescript-eslint/no-require-imports": 0, "@typescript-eslint/no-require-imports": 0,
"@typescript-eslint/no-this-alias": 0, "@typescript-eslint/no-this-alias": 0,
"@typescript-eslint/no-triple-slash-reference": 2, "@typescript-eslint/no-triple-slash-reference": "error",
"@typescript-eslint/no-type-alias": 0, "@typescript-eslint/no-type-alias": 0,
"@typescript-eslint/no-unnecessary-qualifier": 2, "@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-assertion": 2, "@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-unused-vars": ["error", { "varsIgnorePattern": "^_" } ], "@typescript-eslint/no-unused-vars": ["error", { "varsIgnorePattern": "^_" } ],
"@typescript-eslint/no-use-before-define": 2, "@typescript-eslint/no-use-before-define": "error",
"@typescript-eslint/no-useless-constructor": 2, "@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": 0, "@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/prefer-for-of": 0, "@typescript-eslint/prefer-for-of": 0,
"@typescript-eslint/prefer-function-type": 0, "@typescript-eslint/prefer-function-type": 0,
"@typescript-eslint/prefer-includes": 2, "@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-interface": 0, "@typescript-eslint/prefer-interface": 0,
"@typescript-eslint/prefer-namespace-keyword": 2, "@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/prefer-regexp-exec": 2, "@typescript-eslint/prefer-regexp-exec": "error",
"@typescript-eslint/prefer-string-starts-ends-with": 2, "@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": 2, "@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/restrict-plus-operands": 0, "@typescript-eslint/restrict-plus-operands": 0,
"@typescript-eslint/semi": 2, "@typescript-eslint/semi": "error",
"@typescript-eslint/type-annotation-spacing": 2, "@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": 0, "@typescript-eslint/unbound-method": 0,
"@typescript-eslint/unified-signatures": 2 "@typescript-eslint/unified-signatures": "error"
} }
} }
] ]