-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
65 lines (64 loc) · 1.65 KB
/
eslint.config.js
File metadata and controls
65 lines (64 loc) · 1.65 KB
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
import antfu from '@antfu/eslint-config';
export default antfu(
{
unocss: true,
node: true,
ignores: [
'dist/**',
'.vscode/**',
'.idea/**',
'node_modules/**',
'src/uni_modules/**',
'README.md',
],
},
{
rules: {
// vue顶级标签的顺序
'vue/block-order': ['error', {
order: ['template', 'script', 'style'],
}],
// 需要尾随逗号
'comma-dangle': ['error', 'only-multiline'],
// 允许console
'no-console': 'off',
// 需要分号
'style/semi': ['error', 'always'],
// 块内的空行
'padded-blocks': ['error', 'never'],
// 顶级函数应使用 function 关键字声明
'antfu/top-level-function': 'off',
// 全局的 process 不能用
'node/prefer-global/process': 'off',
// 禁止未使用的捕获组
'regexp/no-unused-capturing-group': 'off',
// 允许接口和类型别名中的成员之间使用三个分隔符
'style/member-delimiter-style': ['error', {
multiline: {
delimiter: 'semi',
requireLast: true,
},
singleline: {
delimiter: 'semi',
requireLast: false,
},
multilineDetection: 'brackets',
}],
// if 语句后需要换行
'antfu/if-newline': 'off',
'vue/html-self-closing': [
'error',
{
html: {
void: 'always',
normal: 'any',
component: 'any',
},
svg: 'always',
math: 'always',
},
],
'vue/component-name-in-template-casing': ['error', 'kebab-case'],
},
},
);