Skip to content

Commit ae151e0

Browse files
committed
prettier on xml as well
1 parent 884a527 commit ae151e0

File tree

2 files changed

+71
-5
lines changed

2 files changed

+71
-5
lines changed

.prettierrc

Lines changed: 69 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,81 @@
11
{
2-
"plugins": ["prettier-plugin-apex"],
2+
"arrowParens": "avoid",
3+
"bracketSpacing": true,
4+
"bracketSameLine": true,
5+
"printWidth": 120,
6+
"semi": true,
7+
"singleQuote": true,
38
"trailingComma": "none",
9+
"endOfLine": "lf",
10+
"apexInsertFinalNewline": false,
411
"useTabs": true,
512
"overrides": [
613
{
714
"files": "**/lwc/**/*.html",
815
"options": { "parser": "lwc" }
916
},
17+
{
18+
"files": "*.{cls,trigger}",
19+
"options": { "parser": "apex", "tabWidth": 2, "useTabs": true }
20+
},
21+
{
22+
"files": "*.trigger",
23+
"options": { "printWidth": 200 }
24+
},
1025
{
1126
"files": "*.{cmp,page,component}",
12-
"options": { "parser": "html" }
27+
"options": {
28+
"parser": "html",
29+
"useTabs": true,
30+
"htmlWhitespaceSensitivity": "css"
31+
}
32+
},
33+
{
34+
"files": "*.{apex,soql}",
35+
"options": { "parser": "apex-anonymous" }
36+
},
37+
{
38+
"files": "*.{yml,yaml}",
39+
"options": { "parser": "yaml", "tabWidth": 2, "useTabs": false }
40+
},
41+
{
42+
"files": ".prettier*",
43+
"options": { "parser": "json", "printWidth": 80, "useTabs": true }
44+
},
45+
{
46+
"files": "*.xml",
47+
"options": {
48+
"parser": "xml",
49+
"useTabs": true,
50+
"singleQuote": false,
51+
"xmlSelfClosingSpace": true
52+
}
53+
},
54+
{
55+
"files": ["**/pmd/*.xml", "*ruleset*.xml", "config/**/*.xml"],
56+
"options": {
57+
"parser": "xml",
58+
"xmlSelfClosingSpace": true,
59+
"xmlWhitespaceSensitivity": "ignore"
60+
}
61+
},
62+
{
63+
"files": "*meta.xml",
64+
"options": {
65+
"parser": "xml",
66+
"useTabs": false,
67+
"xmlSelfClosingSpace": false
68+
}
69+
},
70+
{
71+
"files": "*.json",
72+
"options": {
73+
"parser": "json-stringify",
74+
"useTabs": false,
75+
"tabWidth": 2
76+
}
1377
}
14-
]
78+
],
79+
"plugins": ["prettier-plugin-apex", "@prettier/plugin-xml"],
80+
"$schema": "https://json.schemastore.org/prettierrc"
1581
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"description": "Apex Trigger Actions Framework",
66
"scripts": {
77
"prepare": "husky",
8-
"prettier": "prettier --write \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,yaml,yml}\"",
9-
"prettier:verify": "prettier --list-different \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,yaml,yml}\""
8+
"prettier": "prettier --write \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"",
9+
"prettier:verify": "prettier --list-different \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\""
1010
},
1111
"devDependencies": {
1212
"@prettier/plugin-xml": "^3.4.1",

0 commit comments

Comments
 (0)