罗广辉
2026-04-24 648904d076ae6e17892b40675598b1c8dc474277
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
import antfu from '@antfu/eslint-config'
 
export default antfu(
  {
    unocss: true,
    node: true,
    ignores: [
      'dist/**',
      '.vscode/**',
      '.idea/**',
      'node_modules/**',
      'src/uni_modules/**',
      'src/manifest.json',
      'src/pages.json',
      'README.md',
    ],
  },
  {
    rules: {
      // vue顶级标签的顺序
      'vue/block-order': ['error', {
        order: ['template', 'script', 'style'],
      }],
      // 不需要尾随逗号
      'comma-dangle': ['error', 'never'],
      // 允许console
      'no-console': 'off',
      // 不需要分号
      'style/semi': ['error', 'never'],
      // 块内的空行
      '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: 'none',
          requireLast: false,
        },
        singleline: {
          delimiter: 'none',
          requireLast: false,
        },
        multilineDetection: 'brackets',
      }],
      // if 语句后需要换行
      'antfu/if-newline': 'off',
    },
  },
)