Skip to content

Commit

Permalink
add pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Benricheson101 committed Oct 21, 2024
1 parent e20d2ab commit b2d5afb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
7 changes: 7 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

staged_files=$(git diff --cached --name-only --diff-filter ACMR)
pnpm fmt
git add $staged_files

pnpm test
16 changes: 5 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,16 @@
"build": "tsc",
"lint": "biome lint .",
"fmt": "biome check . --write",
"test": "node --disable-warning=ExperimentalWarning --test --enable-source-maps"
"test": "node --disable-warning=ExperimentalWarning --test --enable-source-maps",
"prepare": "husky"
},
"keywords": [
"util",
"utility"
],
"keywords": ["util", "utility"],
"license": "MIT",
"devDependencies": {
"@biomejs/biome": "^1.9.1",
"@types/node": "^20.11.16",
"husky": "^9.1.6",
"typescript": "^5.3.3"
},
"files": [
"build",
"biome.json",
"tsconfig.json",
"LICENSE"
]
"files": ["build", "biome.json", "tsconfig.json", "LICENSE"]
}
10 changes: 10 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b2d5afb

Please sign in to comment.