Scope pre-commit lint and format to staged files

This commit is contained in:
Mohamed Boudra
2026-04-24 12:00:26 +07:00
parent 0c3d15ffb9
commit 6b84c8963d
2 changed files with 9 additions and 6 deletions

View File

@@ -1,9 +1,11 @@
pre-commit:
parallel: true
commands:
format:
run: npm run format:check
lint:
run: npm run lint
typecheck:
jobs:
- name: format
glob: "*.{css,js,json,jsonc,jsx,md,ts,tsx,yaml,yml}"
run: npm run format:check:files -- {staged_files}
- name: lint
glob: "*.{js,jsx,ts,tsx}"
run: npm run lint -- {staged_files}
- name: typecheck
run: npm run typecheck

View File

@@ -48,6 +48,7 @@
"format": "oxfmt .",
"format:files": "oxfmt",
"format:check": "oxfmt --check .",
"format:check:files": "oxfmt --check",
"lint": "oxlint",
"lint:fix": "oxlint --fix",
"knip": "knip",