/
index.ts
46 lines (43 loc) · 1.27 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
import type { ChoiceSupportOption, PathArraySupportOption } from 'prettier';
import { CATEGORY_PUG } from '../constants';
import type { PugEmptyAttributes } from './types';
/** Pug empty attributes option. */
export const PUG_EMPTY_ATTRIBUTES_OPTION: ChoiceSupportOption<PugEmptyAttributes> =
{
since: '1.10.0',
category: CATEGORY_PUG,
type: 'choice',
default: 'as-is',
description: 'Change behavior of boolean attributes.',
choices: [
{
value: 'as-is',
description: 'Nothing is changed.',
},
{
value: 'none',
description:
'Every attribute with empty quotes will have them removed.',
},
{
value: 'all',
description:
'Every boolean attribute will be expressed with empty quotes.',
},
],
};
/** Pug empty attributes force quotes option. */
export const PUG_EMPTY_ATTRIBUTES_FORCE_QUOTES_OPTION: PathArraySupportOption =
{
since: '1.10.0',
category: CATEGORY_PUG,
type: 'path',
default: [{ value: [] }],
array: true,
description:
'Define a list of patterns for attributes that will be forced to have empty quotes even with "none" selected.',
};
export type {
PugEmptyAttributes,
PugEmptyAttributesForceQuotes,
} from './types';