forgejo-website/.prettierrc
oliverpool 31f0b7cae1 add pre-commit hook to automatically format staged files (#80)
This PR:
- fixes the prettier config (the `-astro` plugin must be explicitly registered with pnpm)
- adds [`pretty-quick`](https://github.com/azz/pretty-quick) to be able to format the staged changes
- add [ `husky`](https://typicode.github.io/husky/) to easily add a pre-commit hook which calls `pretty-quick` on commit

I updated the README to document the added commands:
- `pnpm run prepare` to add the pre-commit hook
- `pnpm run format-staged` to format the staged files

Co-authored-by: oliverpool <git@olivier.pfad.fr>
Reviewed-on: https://codeberg.org/forgejo/website/pulls/80
2023-02-02 09:26:59 +00:00

17 lines
311 B
Text

{
"printWidth": 120,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": true,
"overrides": [
{
"files": [".*", "*.json", "*.md", "*.toml", "*.yml"],
"options": {
"useTabs": false
}
}
],
"plugins": ["prettier-plugin-astro"]
}