-
Notifications
You must be signed in to change notification settings - Fork 10
/
.eslintrc.js
69 lines (69 loc) · 1.67 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
module.exports = {
root: true,
env: {
node: true
},
extends: ['plugin:vue/vue3-essential', '@vue/typescript/recommended', '@vue/prettier'],
// extends: ['plugin:vue/vue3-essential', 'eslint:recommended', '@vue/typescript/recommended', 'prettier', '@vue/prettier', '@vue/prettier/@typescript-eslint'],
plugins: ['prettier'],
parserOptions: {
ecmaVersion: 2017
},
rules: {
'prettier/prettier': 'error',
'arrow-body-style': 'off',
'prefer-arrow-callback': 'off',
'vue/multi-word-component-names': 'off',
'vue/camelcase': 'error',
'@typescript-eslint/no-unused-vars': ['warn'],
'@typescript-eslint/no-inferrable-types': 'off',
'vue/attributes-order': [
'error',
{
order: [
'DEFINITION',
'LIST_RENDERING',
'CONDITIONALS',
'RENDER_MODIFIERS',
'GLOBAL',
['UNIQUE', 'SLOT'],
'TWO_WAY_BINDING',
'OTHER_DIRECTIVES',
'OTHER_ATTR',
'EVENTS',
'CONTENT'
],
alphabetical: false
}
], //属性名顺序
'vue/html-closing-bracket-newline': [
'error',
{
singleline: 'never',
multiline: 'always'
}
], //右括号换行
'vue/v-on-event-hyphenation': [
'error',
'always',
{
autofix: true,
ignore: []
}
] //事件名横线隔开
},
overrides: [
{
files: ['**/__tests__ /*.{j,t}s?(x)', '**/tests/unit /**/*.spec.{j,t}s?(x)'],
env: {
mocha: true
}
}
],
globals: {
defineProps: 'readonly',
defineEmits: 'readonly',
withDefaults: 'readonly',
defineExpose: 'readonly'
}
}