-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
62 lines (60 loc) · 1.57 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
import { FlatCompat } from '@eslint/eslintrc'
import { defineFlatConfig } from 'eslint-define-config'
import eslintPluginPerfectionist from 'eslint-plugin-perfectionist'
import eslintPluginTypeScript from 'typescript-eslint'
const compat = new FlatCompat({
baseDirectory: import.meta.dirname
})
export default defineFlatConfig([
{
ignores: ['**/dist/', '**/.history/', '**/vite.config.ts']
},
...compat.extends('eslint-config-standard'),
...compat.extends('eslint-config-prettier'),
{
plugins: {
perfectionist: eslintPluginPerfectionist
},
rules: {
'perfectionist/sort-imports': [
'error',
{
type: 'alphabetical',
order: 'asc',
ignoreCase: true,
specialCharacters: 'keep',
internalPattern: ['^@/.+'],
partitionByComment: false,
partitionByNewLine: false,
newlinesBetween: 'always',
maxLineLength: undefined,
groups: [
'type',
['builtin', 'external'],
'internal-type',
'internal',
['parent-type', 'sibling-type', 'index-type'],
['parent', 'sibling', 'index'],
'object',
'unknown'
]
}
]
}
},
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: eslintPluginTypeScript.parser,
parserOptions: {
project: true
}
},
plugins: {
'@typescript-eslint': eslintPluginTypeScript.plugin
},
rules: {
...eslintPluginTypeScript.configs.recommended.rules
}
}
])