-
Notifications
You must be signed in to change notification settings - Fork 4
/
.eslintrc.json5
74 lines (74 loc) · 1.96 KB
/
.eslintrc.json5
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
{
root: true,
parser: "'parser': '@typescript-eslint/parser'",
parserOptions: {
ecmaVersion: "latest",
parser: "@typescript-eslint/parser",
sourceType: "module",
},
plugins: ["@typescript-eslint", "vue"],
env: {
browser: true,
node: true,
es2022: true,
webextensions: true,
},
globals: {
PlatformHelper: true,
DebugUtil: true,
WorkerNavigator: true,
Settings: true,
ClipboardItem: true,
},
extends: [
"plugin:vue/vue3-recommended",
"plugin:vue/vue3-strongly-recommended",
"eslint:recommended",
"prettier",
],
// add your custom rules here
//it is base on https://github.com/vuejs/eslint-config-vue
rules: {
// 'no-unused-vars': [ERROR, { argsIgnorePattern: '^_|event' }], //禁止有没用的变量,除event和_标记
"no-unused-vars": 0,
"no-debugger": 1,
//生产环境禁止有debugger,测试环境警告
"no-catch-shadow": 2,
//禁止catch子句参数与外部作用域变量同名
"no-dupe-keys": 2,
//在创建对象字面量时不允许键重复 {a:1,a:1}
"no-dupe-args": 2,
//函数参数不能重复
"no-duplicate-case": 2,
//switch中的case标签不能重复
"no-invalid-regexp": 2,
//禁止无效的正则表达式
"no-var": 0,
//禁用var,用let和const代替
"no-prototype-builtins": 0,
//允许直接使用 Object.prototypes 的内置属性
"new-cap": [
2,
{
//首字母大小写
newIsCap: true,
capIsNew: false,
},
],
"vue/component-definition-name-casing": [2, "PascalCase"],
// 组件名字必须遵循大驼峰
"vue/multi-word-component-names": 0,
// 不监测组件名字是否是多个单词
"vue/no-v-html": 0,
//不检测是否有v-html
"vue/require-prop-types": 2,
//不检测prop是否给类型
"vue/first-attribute-linebreak": [
2,
{
singleline: "beside",
multiline: "below",
},
],
},
}