chore: add prettier formatting to html

This commit is contained in:
2025-11-10 18:30:07 +13:00
parent 2aded2ddd7
commit 97626337aa
4 changed files with 44 additions and 0 deletions

View File

@ -21,6 +21,15 @@ repos:
- id: ruff-format
types_or: [python, pyi]
- repo: local
hooks:
- id: prettier-jinja-templates
name: Format Jinja templates with Prettier
entry: pnpm exec prettier --plugin=prettier-plugin-jinja-template --parser=jinja-template --write
language: system
types: [file]
files: ^templates/.*\.html$
# - repo: local
# hooks:
# - id: django-check

11
.prettierrc.json Normal file
View File

@ -0,0 +1,11 @@
{
"plugins": ["prettier-plugin-jinja-template"],
"overrides": [
{
"files": "templates/**/*.html",
"options": {
"parser": "jinja-template"
}
}
]
}

View File

@ -12,6 +12,8 @@
"@tailwindcss/postcss": "^4.1.16",
"daisyui": "^5.4.3",
"postcss": "^8.5.6",
"prettier": "^3.6.2",
"prettier-plugin-jinja-template": "^2.1.0",
"tailwindcss": "^4.1.16"
},
"keywords": [

22
pnpm-lock.yaml generated
View File

@ -20,6 +20,12 @@ importers:
postcss:
specifier: ^8.5.6
version: 8.5.6
prettier:
specifier: ^3.6.2
version: 3.6.2
prettier-plugin-jinja-template:
specifier: ^2.1.0
version: 2.1.0(prettier@3.6.2)
tailwindcss:
specifier: ^4.1.16
version: 4.1.16
@ -363,6 +369,16 @@ packages:
resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==}
engines: {node: ^10 || ^12 || >=14}
prettier-plugin-jinja-template@2.1.0:
resolution: {integrity: sha512-mzoCp2Oy9BDSug80fw3B3J4n4KQj1hRvoQOL1akqcDKBb5nvYxrik9zUEDs4AEJ6nK7QDTGoH0y9rx7AlnQ78Q==}
peerDependencies:
prettier: ^3.0.0
prettier@3.6.2:
resolution: {integrity: sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==}
engines: {node: '>=14'}
hasBin: true
source-map-js@1.2.1:
resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==}
engines: {node: '>=0.10.0'}
@ -645,6 +661,12 @@ snapshots:
picocolors: 1.1.1
source-map-js: 1.2.1
prettier-plugin-jinja-template@2.1.0(prettier@3.6.2):
dependencies:
prettier: 3.6.2
prettier@3.6.2: {}
source-map-js@1.2.1: {}
tailwindcss@4.1.16: {}