-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
115 lines (114 loc) · 2.31 KB
/
eslint.config.mjs
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import {
comments,
defineConfig,
imports,
javascript,
jsonc,
markdown,
react,
regexp,
toml,
typescript,
unicorn,
vue,
// svelte,
yaml
} from '@kazupon/eslint-config'
export default defineConfig(
javascript(),
comments(),
regexp(),
unicorn({
rules: {
'unicorn/prevent-abbreviations': 'off',
'unicorn/no-nested-ternary': 'off', // conflict with prettier
'unicorn/filename-case': [
'error',
{
cases: {
pascalCase: true,
camelCase: true
}
}
],
'unicorn/no-array-for-each': 'off'
}
}),
typescript({
parserOptions: {
project: ['./tsconfig.json']
},
// TODO:
// sometimes, Resolving `parserOptions.project` is not working in `.svelte` files.
// extraFileExtensions: ['.vue', '.svelte']
extraFileExtensions: ['.vue'],
rules: {
'@typescript-eslint/consistent-type-imports': ['error', { disallowTypeAnnotations: false }]
}
}),
imports({
typescript: true,
rules: {
'import/first': 'error',
'import/extensions': ['error', 'always', { ignorePackages: true }]
}
}),
jsonc({
json: true,
jsonc: true,
json5: true,
prettier: true
}),
toml({
rules: {
'toml/array-bracket-spacing': 'off' // conflict with prettier
}
}),
react({
refresh: true,
rules: {
'react/react-in-jsx-scope': 'off'
}
}),
vue({
typescript: true,
rules: {
'vue/multi-word-component-names': 'off',
'vue/singleline-html-element-content-newline': 'off', // conflict with prettier
'vue/max-attributes-per-line': 'off' // conflict with prettier
}
}),
// TODO:
// sometimes, Resolving `parserOptions.project` is not working in `.svelte` files.
// svelte({
// typescript: true
// }),
yaml({
prettier: true
}),
{
name: 'settings',
settings: {
react: {
version: '18'
}
}
},
markdown(),
{
name: 'ignores',
ignores: [
// TODO:
// sometimes, Resolving `parserOptions.project` is not working in `.svelte` files.
'.vscode/**',
'**/*.svelte',
'**/*.config.ts',
'**/dist/*',
'**/tsconfig.json',
'**/fixtures/**',
'**/*.d.ts',
'pnpm-lock.yaml',
'pnpm-workspace.yaml'
]
}
)