You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/usage.md
+7-28Lines changed: 7 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ Create a `git-hooks.config.{ts,js,mjs,cjs,json}` file in your project root:
17
17
importtype { GitHooksConfig } from'bun-git-hooks'
18
18
19
19
const config:GitHooksConfig= {
20
-
//Using staged-lint for efficient file-specific linting
20
+
//Note: staged-lint is only available in pre-commit hook
21
21
'pre-commit': {
22
22
'staged-lint': {
23
23
'*.{js,ts}': 'bunx --bun eslint . --fix',
@@ -67,13 +67,13 @@ git-hooks remove # alias
67
67
# Enable verbose logging
68
68
git-hooks --verbose
69
69
70
-
# Run staged lint for a specific hook
70
+
# Run staged lint for pre-commit hook
71
71
git-hooks run-staged-lint pre-commit
72
72
```
73
73
74
74
## Staged Lint Usage
75
75
76
-
The `staged-lint` feature allows you to run specific commands on staged files matching certain patterns. This is more efficient than running commands on all files.
76
+
The `staged-lint` feature is only available in the pre-commit hook. It allows you to run specific commands on staged files matching certain patterns. This is more efficient than running commands on all files.
thrownewError('[ERROR] Config was not found! Please add `.git-hooks.config.{ts,js,mjs,cjs,mts,cts,json}` or `git-hooks.config.{ts,js,mjs,cjs,mts,cts,json}` or the `git-hooks` entry in package.json.\r\nCheck README for details')
191
+
thrownewError('[ERROR] Config was not found! Please add `.git-hooks.config.{ts,js,mjs,cjs,json}` or `git-hooks.config.{ts,js,mjs,cjs,json}` or the `git-hooks` entry in package.json.\r\nCheck README for details')
192
+
193
+
// Always use the provided configFile if available, otherwise use the cached config
0 commit comments