From 8193a3d83d463717b873392b248873fdef0acaa9 Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期五, 18 十一月 2022 12:15:29 +0800 Subject: [PATCH] 1 --- .eslintrc.js | 90 ++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 80 insertions(+), 10 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 37e04a1..22c7fc5 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,14 +1,84 @@ module.exports = { - root: true, - env: { + 'root': true, + 'env': { + browser: true, node: true, + jest: true, + es6: true }, - extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"], - parserOptions: { - parser: "babel-eslint", + 'extends': [ + 'plugin:vue/essential', + 'eslint:recommended' + ], + 'parserOptions': { + parser: '@babel/eslint-parser' }, - rules: { - "no-console": process.env.NODE_ENV === "production" ? "warn" : "off", - "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", - }, -}; + 'rules': { + 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'prefer-const': 'error', + 'no-const-assign': 'error', + 'no-var': 'error', + 'no-new-object': 'error', + 'no-array-constructor': 'error', + 'prefer-destructuring': 'error', + 'quotes': ['error', 'single'], + 'prefer-template': 'error', + 'template-curly-spacing': 'error', + 'no-eval': 'error', + 'no-useless-escape': 'error', + 'no-loop-func': 'error', + 'prefer-rest-params': 'error', + 'default-param-last': 'error', + 'no-new-func': 'error', + 'space-before-function-paren': 0, + 'no-param-reassign': 'error', + 'arrow-parens': 'error', + 'no-confusing-arrow': 'error', + 'implicit-arrow-linebreak': 'error', + 'no-useless-constructor': 'error', + 'no-dupe-class-members': 'error', + 'class-methods-use-this': 'error', + 'no-duplicate-imports': 'error', + 'dot-notation': 'error', + 'no-restricted-properties': 'error', + 'no-undef': 'error', + 'one-var': 'error', + 'no-multi-assign': 'error', + 'no-plusplus': 'error', + 'no-unused-vars': ['error', { + 'vars': 'all', + 'args': 'none' + }], + 'eqeqeq': 'error', + 'no-nested-ternary': 'error', + 'no-unneeded-ternary': 'error', + 'no-mixed-operators': 'error', + 'nonblock-statement-body-position': 'error', + 'brace-style': 'error', + 'no-else-return': 'error', + 'spaced-comment': 'error', + 'space-before-blocks': 'error', + 'keyword-spacing': 'error', + 'space-infix-ops': 'error', + 'eol-last': 'error', + 'newline-per-chained-call': 'error', + 'no-whitespace-before-property': 'error', + 'space-in-parens': 'error', + 'array-bracket-spacing': 'error', + 'max-len': ['error', { code: 100, ignoreUrls: true }], + 'block-spacing': 'error', + 'comma-spacing': 'error', + 'func-call-spacing': 'error', + 'key-spacing': 'error', + 'no-trailing-spaces': 'error', + 'no-multiple-empty-lines': 'error', + 'comma-style': 'error', + 'comma-dangle': 'error', + 'semi': ['error', 'never'], + 'camelcase': 'error', + 'no-underscore-dangle': 'error', + 'no-restricted-globals': 'error', + 'quote-props': ['error', 'consistent'] + } +} \ No newline at end of file -- Gitblit v1.9.3