forked from vitest-dev/docs-cn
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
74 lines (71 loc) · 1.89 KB
/
eslint.config.js
File metadata and controls
74 lines (71 loc) · 1.89 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
import antfu, { GLOB_SRC } from '@antfu/eslint-config'
export default antfu(
{
stylistic: true,
typescript: true,
vue: true,
jsonc: false,
yaml: false,
ignores: [
'dist',
'node_modules',
'*.svelte',
'*.snap',
'*.d.ts',
'coverage',
'!.vitepress',
// contains technically invalid code to display pretty diff
'guide/snapshot.md',
// uses invalid js example
'advanced/api/import-example.md',
'api/advanced/import-example.md',
'guide/examples/*.md',
],
},
{
rules: {
// prefer global Buffer to not initialize the whole module
'node/prefer-global/buffer': 'off',
'node/prefer-global/process': 'off',
'no-empty-pattern': 'off',
'antfu/indent-binary-ops': 'off',
'unused-imports/no-unused-imports': 'error',
'style/member-delimiter-style': [
'error',
{
multiline: { delimiter: 'none' },
singleline: { delimiter: 'semi' },
},
],
// let TypeScript handle this
'no-undef': 'off',
'ts/no-invalid-this': 'off',
'eslint-comments/no-unlimited-disable': 'off',
'curly': ['error', 'all'],
// TODO: migrate and turn it back on
'ts/ban-types': 'off',
'ts/no-unsafe-function-type': 'off',
'no-restricted-imports': [
'error',
{
paths: ['path'],
},
],
'import/no-named-as-default': 'off',
'style/max-statements-per-line': 'off',
},
},
{
files: [`**/*.md`, `**/*.md/${GLOB_SRC}`],
rules: {
'perfectionist/sort-imports': 'off',
'import/newline-after-import': 'off',
'import/first': 'off',
'unused-imports/no-unused-imports': 'off',
'ts/method-signature-style': 'off',
'no-self-compare': 'off',
'import/no-mutable-exports': 'off',
'no-restricted-globals': 'off',
},
},
)