-
-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy patheslint.config.js
More file actions
95 lines (90 loc) · 2.64 KB
/
eslint.config.js
File metadata and controls
95 lines (90 loc) · 2.64 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import antfu, { GLOB_SRC } from '@antfu/eslint-config'
import { createSimplePlugin } from 'eslint-factory'
export default antfu(
{
stylistic: true,
typescript: true,
vue: true,
jsonc: false,
yaml: false,
ignores: [
'*.d.ts',
'!.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',
'pnpm/json-enforce-catalog': 'off',
'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',
'markdown/fenced-code-language': 'off',
// it uses parser which is not compatible with vitepress
'markdown/no-missing-link-fragments': 'off',
'no-restricted-imports': [
'error',
{
paths: ['path'],
},
],
'import/no-named-as-default': 'off',
},
},
{
files: [`**/*.md`, `**/*.md/${GLOB_SRC}`],
rules: {
'no-restricted-globals': 'off',
'prefer-arrow-callback': 'off',
'e18e/prefer-array-at': 'off',
'perfectionist/sort-imports': 'off',
'style/max-statements-per-line': '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-throw-literal': 'off',
},
},
createSimplePlugin({
name: 'no-vitepress-plugin-llms',
include: ['*.ts', '**/*.ts'],
create(context) {
return {
ImportDeclaration(node) {
if (node.type === 'ImportDeclaration' && node.source.value === 'vitepress-plugin-llms') {
context.report({
node,
message: 'Don\'t import vitepress-plugin-llms, only need to be installed in the upstream repository.',
})
}
},
}
},
}),
)