-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprettier.config.js
More file actions
88 lines (88 loc) · 1.99 KB
/
Copy pathprettier.config.js
File metadata and controls
88 lines (88 loc) · 1.99 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
module.exports = {
$schema: 'https://json.schemastore.org/prettierrc',
htmlWhitespaceSensitivity: 'ignore',
printWidth: 120,
tabWidth: 2,
proseWrap: 'always',
useTabs: false,
semi: true,
singleQuote: true,
trailingComma: 'none',
endOfLine: 'auto',
bracketSpacing: true,
arrowParens: 'avoid',
plugins: [
// https://github.com/prettier/prettier-vscode/issues/2259#issuecomment-952950119
require.resolve('prettier-plugin-organize-attributes'),
require.resolve('@prettier/plugin-xml'),
],
attributeGroups: [
// prettier-plugin-organize-attribute
'$ANGULAR_STRUCTURAL_DIRECTIVE',
'$ANGULAR_ELEMENT_REF',
'$ID',
'$DEFAULT',
'$CLASS',
'$ANGULAR_ANIMATION',
'$ANGULAR_ANIMATION_INPUT',
'$ANGULAR_INPUT',
'$ANGULAR_TWO_WAY_BINDING',
'$ANGULAR_OUTPUT',
],
overrides: [
{
files: ['*.json', '.prettierrc', '.stylelintrc'],
options: { parser: 'json' },
},
{
files: ['package.json', 'ng-package.json'],
options: {
parser: 'json-stringify',
plugins: [
require('path').resolve(
__dirname,
'plugins',
'prettier-plugin-sort-package'
),
],
},
},
{
files: ['*.less'],
options: { parser: 'less' },
},
{
files: ['*.scss'],
options: { parser: 'scss' },
},
{
files: ['*.js', '*.ts'],
options: {printWidth: 120, parser: 'typescript'},
},
{
files: '*.html',
options: {printWidth: 120, parser: 'html'},
},
{
files: ['*.component.html', '*.template.html'],
options: { parser: 'angular' },
},
{
files: ['*.svg'],
options: { parser: 'xml' },
},
{
// @prettier/plugin-xml
files: ['*.xml'],
options: { parser: 'xml' },
},
{
files: ['*.yml', '*.yaml'],
options: { parser: 'yaml', tabWidth: 2 },
},
{
files: ['*.md'],
options: { parser: 'markdown', tabWidth: 2 },
},
],
};