-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
57 lines (57 loc) · 1.73 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
module.exports = {
root: true,
env: {
node: true,
},
parser: "vue-eslint-parser",
parserOptions: {
// for script
parser: "@typescript-eslint/parser",
ecmaVersion: 2020,
},
extends: [
"eslint:recommended",
"plugin:import/recommended",
"plugin:import/typescript", // this line does the trick
"plugin:vue/vue3-strongly-recommended",
"@vue/typescript/recommended",
"@vue/prettier",
"@vue/prettier/@typescript-eslint",
],
plugins: ["import"],
settings: {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"],
},
// eslint-import-resolver-webpack
"import/resolver": {
webpack: {
// 参考 https://cli.vuejs.org/zh/guide/webpack.html#%E4%BB%A5%E4%B8%80%E4%B8%AA%E6%96%87%E4%BB%B6%E7%9A%84%E6%96%B9%E5%BC%8F%E4%BD%BF%E7%94%A8%E8%A7%A3%E6%9E%90%E5%A5%BD%E7%9A%84%E9%85%8D%E7%BD%AE
config: "./node_modules/@vue/cli-service/webpack.config.js",
},
},
},
rules: {
"no-console": [1, { allow: ["warn", "error"] }],
"no-debugger": 2,
"no-case-declarations": 0,
"import/order": 1,
// https://eslint.vuejs.org/rules/
"vue/require-default-prop": 0,
},
overrides: [
{
files: ["**/__tests__/*.{j,t}s?(x)", "**/tests/unit/**/*.spec.{j,t}s?(x)"],
env: {
jest: true,
},
},
{
files: ["*.ts", "*.tsx", "*.vue"],
plugins: ["@typescript-eslint"],
rules: {
"@typescript-eslint/no-explicit-any": [2, { ignoreRestArgs: true }],
},
},
],
};