From 33faeafa98012e5138a1c56466917c1cf6e19601 Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Sat, 16 May 2020 16:19:36 -0700 Subject: [PATCH] New proposed ESLint rules that require no code changes --- .eslintrc.js | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index 3cf7ec2e20..a65219828d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,3 +1,4 @@ +const LEGACY_FILES = ["platform/**", "example/**"]; module.exports = { "env": { "browser": true, @@ -66,6 +67,56 @@ module.exports = { ], "dot-notation": "error", "indent": ["error", 4], + + // https://eslint.org/docs/rules/no-case-declarations + "no-case-declarations": "error", + // https://eslint.org/docs/rules/max-classes-per-file + "max-classes-per-file": ["error", 1], + // https://eslint.org/docs/rules/no-eq-null + "no-eq-null": "error", + // https://eslint.org/docs/rules/no-eval + "no-eval": "error", + // https://eslint.org/docs/rules/no-floating-decimal + "no-floating-decimal": "error", + // https://eslint.org/docs/rules/no-implicit-globals + "no-implicit-globals": "error", + // https://eslint.org/docs/rules/no-implied-eval + "no-implied-eval": "error", + // https://eslint.org/docs/rules/no-lone-blocks + "no-lone-blocks": "error", + // https://eslint.org/docs/rules/no-loop-func + "no-loop-func": "error", + // https://eslint.org/docs/rules/no-new-func + "no-new-func": "error", + // https://eslint.org/docs/rules/no-new-wrappers + "no-new-wrappers": "error", + // https://eslint.org/docs/rules/no-octal-escape + "no-octal-escape": "error", + // https://eslint.org/docs/rules/no-proto + "no-proto": "error", + // https://eslint.org/docs/rules/no-return-await + "no-return-await": "error", + // https://eslint.org/docs/rules/no-script-url + "no-script-url": "error", + // https://eslint.org/docs/rules/no-self-compare + "no-self-compare": "error", + // https://eslint.org/docs/rules/no-sequences + "no-sequences": "error", + // https://eslint.org/docs/rules/no-unmodified-loop-condition + "no-unmodified-loop-condition": "error", + // https://eslint.org/docs/rules/no-useless-call + "no-useless-call": "error", + // https://eslint.org/docs/rules/wrap-iife + "wrap-iife": "error", + // https://eslint.org/docs/rules/no-nested-ternary + "no-nested-ternary": "error", + // https://eslint.org/docs/rules/switch-colon-spacing + "switch-colon-spacing": "error", + // https://eslint.org/docs/rules/no-useless-computed-key + "no-useless-computed-key": "error", + // https://eslint.org/docs/rules/rest-spread-spacing + "rest-spread-spacing": ["error"], + "vue/html-indent": [ "error", 4, @@ -112,6 +163,13 @@ module.exports = { } ] } + }, { + "files": LEGACY_FILES, + "rules": { + // https://eslint.org/docs/rules/no-nested-ternary + "no-nested-ternary": "off", + "no-var": "off" + } } ] };