-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
index.ts
50 lines (45 loc) · 1.47 KB
/
index.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
42
43
44
45
46
47
48
49
50
import type { ChoiceSupportOption, PathArraySupportOption } from 'prettier';
import { CATEGORY_PUG } from '../constants';
const pugSortAttributesOption: PathArraySupportOption = {
// since: '1.7.0',
category: CATEGORY_PUG,
type: 'path',
array: true,
default: [{ value: [] }],
description: '',
};
/** Pug sort attributes beginning option. */
export const PUG_SORT_ATTRIBUTES_BEGINNING_OPTION: PathArraySupportOption = {
...pugSortAttributesOption,
description:
'Define a list of patterns for attributes that are sorted to the beginning.',
};
/** Pug sort attributes end option. */
export const PUG_SORT_ATTRIBUTES_END_OPTION: PathArraySupportOption = {
...pugSortAttributesOption,
description:
'Define a list of patterns for attributes that are sorted at the end.',
};
/** Pug sort attributes option. */
export const PUG_SORT_ATTRIBUTES_OPTION: ChoiceSupportOption<PugSortAttributes> =
{
// since: '1.8.0',
category: CATEGORY_PUG,
type: 'choice',
default: 'as-is',
description:
'Change how the attributes between _beginning_ and _end_ should be sorted.',
choices: [
{ value: 'asc', description: 'Sort middle attributes ascending.' },
{
value: 'desc',
description: 'Sort middle attributes descending.',
},
{
value: 'as-is',
description: 'Middle attributes are leave untouched.',
},
],
};
/** Sort attributes. */
export type PugSortAttributes = 'asc' | 'desc' | 'as-is';