|
| 1 | +{ |
| 2 | + "extends": [ |
| 3 | + "plugin:@typescript-eslint/recommended", |
| 4 | + "eslint-config-airbnb-base", |
| 5 | + "@vue/typescript/recommended", |
| 6 | + "plugin:vue/vue3-recommended", |
| 7 | + "plugin:vue-scoped-css/base", |
| 8 | + "plugin:prettier/recommended" |
| 9 | + ], |
| 10 | + "env": { |
| 11 | + "browser": true, |
| 12 | + "node": true, |
| 13 | + "jest": true, |
| 14 | + "es6": true |
| 15 | + }, |
| 16 | + "globals": { |
| 17 | + "defineProps": "readonly", |
| 18 | + "defineEmits": "readonly" |
| 19 | + }, |
| 20 | + "plugins": ["vue", "@typescript-eslint", "simple-import-sort"], |
| 21 | + "parserOptions": { |
| 22 | + "parser": "@typescript-eslint/parser", |
| 23 | + "sourceType": "module", |
| 24 | + "allowImportExportEverywhere": true, |
| 25 | + "ecmaFeatures": { |
| 26 | + "jsx": true |
| 27 | + } |
| 28 | + }, |
| 29 | + "settings": { |
| 30 | + "import/extensions": [".js", ".jsx", ".ts", ".tsx"] |
| 31 | + }, |
| 32 | + "rules": { |
| 33 | + "no-console": "off", |
| 34 | + "no-continue": "off", |
| 35 | + "no-restricted-syntax": "off", |
| 36 | + "no-plusplus": "off", |
| 37 | + "no-param-reassign": "off", |
| 38 | + "no-shadow": "off", |
| 39 | + "guard-for-in": "off", |
| 40 | + |
| 41 | + "import/extensions": "off", |
| 42 | + "import/no-unresolved": "off", |
| 43 | + "import/no-extraneous-dependencies": "off", |
| 44 | + "import/prefer-default-export": "off", |
| 45 | + "import/first": "off", // https://github.com/vuejs/vue-eslint-parser/issues/58 |
| 46 | + "@typescript-eslint/no-explicit-any": "off", |
| 47 | + "@typescript-eslint/explicit-module-boundary-types": "off", |
| 48 | + "vue/first-attribute-linebreak": 0, |
| 49 | + |
| 50 | + |
| 51 | + "@typescript-eslint/no-unused-vars": [ |
| 52 | + "error", |
| 53 | + { |
| 54 | + "argsIgnorePattern": "^_", |
| 55 | + "varsIgnorePattern": "^_" |
| 56 | + } |
| 57 | + ], |
| 58 | + "no-unused-vars": [ |
| 59 | + "error", |
| 60 | + { |
| 61 | + "argsIgnorePattern": "^_", |
| 62 | + "varsIgnorePattern": "^_" |
| 63 | + } |
| 64 | + ], |
| 65 | + "no-use-before-define": "off", |
| 66 | + "@typescript-eslint/no-use-before-define": "off", |
| 67 | + "@typescript-eslint/ban-ts-comment": "off", |
| 68 | + "@typescript-eslint/ban-types": "off", |
| 69 | + "class-methods-use-this": "off", // 因为AxiosCancel必须实例化而能静态化所以加的规则,如果有办法解决可以取消 |
| 70 | + "simple-import-sort/imports": "error", |
| 71 | + "simple-import-sort/exports": "error" |
| 72 | + }, |
| 73 | + "overrides": [ |
| 74 | + { |
| 75 | + "files": ["*.vue"], |
| 76 | + "rules": { |
| 77 | + "vue/component-name-in-template-casing": [2, "kebab-case"], |
| 78 | + "vue/require-default-prop": 0, |
| 79 | + "vue/multi-word-component-names": 0, |
| 80 | + "vue/no-reserved-props": 0, |
| 81 | + "vue/no-v-html": 0, |
| 82 | + "vue-scoped-css/enforce-style-type": ["error", { "allows": ["scoped"] }] |
| 83 | + } |
| 84 | + }, |
| 85 | + { |
| 86 | + "files": ["*.ts", "*.tsx"], // https://github.com/typescript-eslint eslint-recommended |
| 87 | + "rules": { |
| 88 | + "constructor-super": "off", // ts(2335) & ts(2377) |
| 89 | + "getter-return": "off", // ts(2378) |
| 90 | + "no-const-assign": "off", // ts(2588) |
| 91 | + "no-dupe-args": "off", // ts(2300) |
| 92 | + "no-dupe-class-members": "off", // ts(2393) & ts(2300) |
| 93 | + "no-dupe-keys": "off", // ts(1117) |
| 94 | + "no-func-assign": "off", // ts(2539) |
| 95 | + "no-import-assign": "off", // ts(2539) & ts(2540) |
| 96 | + "no-new-symbol": "off", // ts(2588) |
| 97 | + "no-obj-calls": "off", // ts(2349) |
| 98 | + "no-redeclare": "off", // ts(2451) |
| 99 | + "no-setter-return": "off", // ts(2408) |
| 100 | + "no-this-before-super": "off", // ts(2376) |
| 101 | + "no-undef": "off", // ts(2304) |
| 102 | + "no-unreachable": "off", // ts(7027) |
| 103 | + "no-unsafe-negation": "off", // ts(2365) & ts(2360) & ts(2358) |
| 104 | + "no-var": "error", // ts transpiles let/const to var, so no need for vars any more |
| 105 | + "prefer-const": "error", // ts provides better types with const |
| 106 | + "prefer-rest-params": "error", // ts provides better types with rest args over arguments |
| 107 | + "prefer-spread": "error", // ts transpiles spread to apply, so no need for manual apply |
| 108 | + "valid-typeof": "off" // ts(2367) |
| 109 | + } |
| 110 | + } |
| 111 | + ] |
| 112 | +} |
0 commit comments