-
-
Notifications
You must be signed in to change notification settings - Fork 445
/
perfectionist.ts
41 lines (38 loc) · 1.17 KB
/
perfectionist.ts
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
import type { TypedFlatConfigItem } from '../types'
import { pluginPerfectionist } from '../plugins'
/**
* Perfectionist plugin for props and items sorting.
*
* @see https://github.com/azat-io/eslint-plugin-perfectionist
*/
export async function perfectionist(): Promise<TypedFlatConfigItem[]> {
return [
{
name: 'antfu/perfectionist/setup',
plugins: {
perfectionist: pluginPerfectionist,
},
rules: {
'perfectionist/sort-exports': ['error', { order: 'asc', type: 'natural' }],
'perfectionist/sort-imports': ['error', {
groups: [
'type',
['parent-type', 'sibling-type', 'index-type'],
'builtin',
'external',
['internal', 'internal-type'],
['parent', 'sibling', 'index'],
'side-effect',
'object',
'unknown',
],
newlinesBetween: 'ignore',
order: 'asc',
type: 'natural',
}],
'perfectionist/sort-named-exports': ['error', { order: 'asc', type: 'natural' }],
'perfectionist/sort-named-imports': ['error', { order: 'asc', type: 'natural' }],
},
},
]
}