-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
66 lines (64 loc) · 1.68 KB
/
eslint.config.js
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
import antfu from '@antfu/eslint-config'
// import { FlatCompat } from '@eslint/eslintrc'
import pluginQuery from '@tanstack/eslint-plugin-query'
// import tailwind from 'eslint-plugin-tailwindcss'
// const compat = new FlatCompat()
export default antfu(
{
vue: true,
typescript: true,
formatters: {
css: 'prettier',
html: 'prettier',
markdown: 'prettier',
prettierOptions: {
useTabs: false,
tabWidth: 2,
endOfLine: 'lf',
singleQuote: true,
semi: false,
},
},
rules: {
'import/order': ['error', {
'newlines-between': 'always',
'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'],
'pathGroupsExcludedImportTypes': ['type'],
'alphabetize': {
order: 'asc',
},
}],
'no-console': 'off', // 关闭规则,在打包时会自动删除,开发环境可用
'no-debugger': 'off', // 同上
'vue/html-self-closing': ['warn', {
html: {
void: 'always',
normal: 'never',
component: 'always',
},
svg: 'always',
math: 'always',
}],
'perfectionist/sort-imports': 'off',
},
},
{
plugins: {
'@tanstack/query': pluginQuery,
},
},
// {...tailwind.configs["flat/recommended"]},
// ...compat.config({
// extends: [
// 'plugin:tailwindcss/recommended',
// 'plugin:@tanstack/eslint-plugin-query/recommended',
// ],
// plugins: {
// '@tanstack/query': pluginQuery,
// },
// rules: {
// // 关闭禁用自定义类名
// 'tailwindcss/no-custom-classname': 'off',
// },
// }),
)