-
Notifications
You must be signed in to change notification settings - Fork 7
/
.prettierrc.cjs
73 lines (70 loc) · 1.7 KB
/
.prettierrc.cjs
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
67
68
69
70
71
72
73
// @ts-check
/** @type {import('prettier-plugin-organize-attributes').PrettierPluginOrganizeAttributesParserOptions} */
const organizeAttributesPluginAngularConfig = {
attributeGroups: [
'$ANGULAR_STRUCTURAL_DIRECTIVE',
'$ANGULAR_ELEMENT_REF',
'$ID',
'$DEFAULT',
'$CLASS',
'$ANGULAR_INPUT',
'$ANGULAR_TWO_WAY_BINDING',
'$ANGULAR_OUTPUT',
'$ANGULAR_ANIMATION',
'$ANGULAR_ANIMATION_INPUT'
],
attributeSort: 'ASC',
attributeIgnoreCase: true
};
/** @type {import('prettier').Options} */
const config = {
printWidth: 120,
tabWidth: 4,
useTabs: false,
singleQuote: true,
trailingComma: 'none',
htmlWhitespaceSensitivity: 'ignore',
endOfLine: 'lf',
plugins: [
'prettier-plugin-organize-attributes',
'prettier-plugin-organize-imports',
'prettier-plugin-astro',
'prettier-plugin-tailwindcss',
// should be last
'prettier-plugin-multiline-arrays'
],
overrides: [
{
files: ['*.yml'],
options: {
tabWidth: 2
}
},
{
files: ['*.md', '*.mdx'],
options: {
tabWidth: 2
}
},
{
files: ['*.html'],
options: {
parser: 'angular',
...organizeAttributesPluginAngularConfig
}
},
{
files: ['index.html'],
options: {
parser: 'html'
}
},
{
files: '*.astro',
options: {
parser: 'astro'
}
}
]
};
module.exports = config;