-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config copy.js
More file actions
79 lines (70 loc) · 2.17 KB
/
eslint.config copy.js
File metadata and controls
79 lines (70 loc) · 2.17 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import { defineConfig } from '@soybeanjs/eslint-config'
export default defineConfig(
{ vue: true, unocss: true },
{
rules: {
'vue/multi-word-component-names': [
'warn',
{
ignores: ['index', 'App', 'Register', '[id]', '[url]'],
},
],
'vue/component-name-in-template-casing': [
'warn',
'PascalCase',
{
registeredComponentsOnly: false,
ignores: ['/^icon-/'],
},
],
'unocss/order-attributify': 'off',
// 强制使用 type 定义对象类型
'@typescript-eslint/consistent-type-definitions': ['warn', 'type'],
// 强制链式调用在每次调用后换行
'newline-per-chained-call': 'warn',
// 强制将对象属性放在单独的行上
'object-property-newline': 'warn',
// 强制在开括号后和闭括号前使用一致的换行符
'object-curly-newline': [
'warn',
{
ImportDeclaration: { multiline: true, minProperties: 3 },
ExportDeclaration: { multiline: true, minProperties: 1 },
ObjectExpression: 'always',
ObjectPattern: { multiline: true },
},
],
// 强制使用一致的换行风格
'curly': 'warn',
// 强制在注释中 // 或 /* 使用一致的空行
'lines-around-comment': [
'warn',
{
beforeBlockComment: true,
beforeLineComment: true,
allowBlockStart: true,
allowObjectStart: true,
allowArrayStart: true,
ignorePattern: 'eslint|jshint|jslint|istanbul|global|exported|jscs|组件|弹窗',
},
],
// 在特定语句之前和之后添加空行
'padding-line-between-statements': [
'warn',
{
blankLine: 'always',
prev: ['const', 'let', 'var', 'block', 'block-like', 'import', 'export', 'class', 'try', 'return'],
next: '*',
},
],
// 在注释中的 // 或 /*后面强制保持一致的间距
'spaced-comment': [
'warn',
'always',
{
markers: ['!', '@', '#', '$', '%', '^', '&', '*', '(', ')'],
},
],
},
},
)