Skip to content

Commit a342daa

Browse files
committed
Add nginx, sh and sql prettier plugins
1 parent 3de3e0a commit a342daa

File tree

4 files changed

+251
-3
lines changed

4 files changed

+251
-3
lines changed

.prettierignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
*.min.css
55
*.min.js
66

7-
# Nginx files (for now)
8-
**/nginx/
7+
# Bats seems to break Prettier
8+
*.bats
99

1010
# Web templates (for now)
1111
web/templates/

.prettierrc.cjs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
11
module.exports = {
2+
// Plugins
3+
plugins: [
4+
"@prettier/plugin-php",
5+
"prettier-plugin-nginx",
6+
"prettier-plugin-sh",
7+
"prettier-plugin-sql",
8+
],
9+
pluginSearchDirs: ["."],
10+
// PHP Settings
211
phpVersion: "8.1",
312
braceStyle: "1tbs",
13+
// Overrides for some files
14+
overrides: [
15+
// Hestia CLI
16+
{
17+
files: ["bin/v-*", "src/deb/*/{postinst,preinst,hestia,postrm}", "install/common/api/*"],
18+
options: {
19+
parser: "sh",
20+
},
21+
},
22+
// Nginx config
23+
{
24+
files: ["**/nginx/*.inc", "**/nginx/*.conf"],
25+
options: {
26+
parser: "nginx",
27+
},
28+
},
29+
],
430
};

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
"postcss-preset-env": "^7.8.3",
3030
"postcss-size": "^4.0.1",
3131
"prettier": "^2.8.0",
32+
"prettier-plugin-nginx": "^1.0.2",
33+
"prettier-plugin-sh": "^0.12.8",
34+
"prettier-plugin-sql": "^0.12.1",
3235
"stylelint": "^14.15.0",
3336
"stylelint-config-prettier": "^9.0.4",
3437
"stylelint-config-standard": "^29.0.0"

0 commit comments

Comments
 (0)