-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patheslint.config.mjs
More file actions
36 lines (32 loc) · 1009 Bytes
/
Copy patheslint.config.mjs
File metadata and controls
36 lines (32 loc) · 1009 Bytes
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
import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'
export default [
{
ignores: ['dist/**', 'node_modules/**', '**/*.test.ts', 'frontend/**/*', 'tsdown.config.ts']
},
eslint.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.ts'],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: './tsconfig.json',
},
},
rules: {
"no-unused-vars": 0,
"@typescript-eslint/no-unused-vars": 0,
// 控制大括号内容前后有空格
'object-curly-spacing': ['error', 'always'],
// 不使用分号≤
'semi': ['error', 'never'],
// 使用单引号
'quotes': ['error', 'single'],
// 其他常用规则
'comma-dangle': ['error', 'always-multiline'], // 多行对象/数组最后一项加逗号
'indent': ['error', 2], // 缩进2个空格
'arrow-parens': ['error', 'as-needed'], // 箭头函数参数仅在必要时加括号
},
}
]