forked from cloudhao1999/cloud-app-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
75 lines (74 loc) · 2 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
module.exports = {
env: {
browser: true,
es2021: true,
node: true
},
// .vue文件的ESLint自定义解析器。
parser: "vue-eslint-parser",
extends: [
"eslint:recommended", // eslint默认推荐的规范
"plugin:vue/vue3-recommended", // vue3默认的推荐规范
"plugin:@typescript-eslint/recommended", // eslint/typescript 默认的推荐规范
"plugin:prettier/recommended" // 插件约束规范 解决eslint和prettier的冲突问题
],
parserOptions: {
ecmaVersion: "latest",
parser: "@typescript-eslint/parser",
sourceType: "module",
// 支持jsx
ecmaFeatures: {
jsx: true
}
},
// eslint-plugin-vue @typescript-eslint/eslint-plugin 的缩写
plugins: ["vue", "@typescript-eslint"],
globals: {
// Ref sugar (take 2)
$: "readonly",
$$: "readonly",
$ref: "readonly",
$shallowRef: "readonly",
$computed: "readonly",
// script setup
defineProps: "readonly",
defineEmits: "readonly",
defineExpose: "readonly",
withDefaults: "readonly"
},
rules: {
"vue/no-v-html": "off",
"vue/require-default-prop": "off",
"vue/no-deprecated-dollar-listeners-api": "off",
"vue/require-explicit-emits": "off",
"vue/multi-word-component-names": "off",
"@typescript-eslint/no-explicit-any": "off", // any
"no-debugger": "off",
"@typescript-eslint/explicit-module-boundary-types": "off", // setup()
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"no-async-promise-executor": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_"
}
],
"no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_"
}
],
"prettier/prettier": [
"error",
{
endOfLine: "auto"
}
]
}
};