Skip to content

Commit 1def5cd

Browse files
authored
feat: prettier — make html more nice after building it (#301)
feat: `prettier` — make html more nice after building it
2 parents ec9e5a1 + 516a3a0 commit 1def5cd

File tree

4 files changed

+62
-35
lines changed

4 files changed

+62
-35
lines changed

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/node_modules
2+
.env
3+
.vscode
4+
.cache
5+
/**/sitemap.njk
6+
/**/feed.njk

.prettierrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
"trailingComma": "es5",
33
"tabWidth": 2,
44
"semi": false,
5-
"singleQuote": true
5+
"singleQuote": true,
6+
"singleAttributePerLine": false,
7+
"bracketSameLine": true
68
}

package-lock.json

Lines changed: 49 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
"sass:compressed": "sass --no-source-map --style=compressed src/assets/scss:public/css/",
1010
"postcss": "postcss public/css/*.css --use postcss-import autoprefixer postcss-nested --no-map --dir public/css",
1111
"minify:js": "node bin/minify.js",
12+
"prettify:html": "prettier --write public/**/*.html --ignore-path .prettierignore",
1213
"watch": "npm-run-all --parallel watch:*",
1314
"watch:eleventy": "eleventy --serve",
1415
"watch:sass": "npm run sass:compressed -- --watch",
1516
"watch:postcss": "npm run postcss -- --watch",
16-
"build": "npm run sass:compressed && npm run postcss && npm run minify:js && eleventy",
17+
"build": "npm run sass:compressed && npm run postcss && npm run minify:js && eleventy && npm run prettify:html",
1718
"start": "npm-run-all sass:compressed postcss --parallel watch:*",
1819
"dev": "npm run watch"
1920
},
@@ -35,7 +36,8 @@
3536
"postcss": "^8.5.5",
3637
"postcss-cli": "^11.0.1",
3738
"postcss-import": "^16.1.0",
38-
"postcss-nested": "^7.0.2"
39+
"postcss-nested": "^7.0.2",
40+
"prettier": "^3.5.3"
3941
},
4042
"dependencies": {
4143
"@11ty/eleventy-img": "^6.0.4",

0 commit comments

Comments
 (0)