integrate lefthook precommit formatting

This commit is contained in:
maxichrome 2023-01-19 13:06:56 -08:00
parent 62d731aeb9
commit fc2e1e3ae5
2 changed files with 15 additions and 8 deletions

View file

@ -3,12 +3,18 @@
# https://github.com/evilmartians/lefthook/blob/master/docs/full_guide.md #
########################################################################################################################
pre-push:
parallel: true
pre-commit:
commands:
lint:
glob: '*.{ts,tsx}'
run: pnpm eslint {staged_files}
markdown-link-check:
glob: '*.md'
run: pnpm markdown-link-check {staged_files}
# automatically format files, ✨magically✨
prettier:
glob: '[^pnpm-lock]*.{js,jsx,ts,tsx,html,json,yml,yaml,css,scss,md}'
run: pnpm prettier --write {staged_files} && git add {staged_files}
# pre-push:
# parallel: true
# commands:
# lint:
# glob: '*.{ts,tsx}'
# run: pnpm eslint {staged_files}
# markdown-link-check:
# glob: '*.md'
# run: pnpm markdown-link-check {staged_files}

View file

@ -3,6 +3,7 @@
"version": "0.0.0",
"private": true,
"scripts": {
"postinstall": "lefthook install",
"prep": "pnpm gen:prisma && cargo test -p sd-core api::tests::test_and_export_rspc_bindings -- --exact",
"build": "turbo run build",
"landing-web": "turbo run dev --parallel --filter=@sd/landing --filter=@sd/web",