Skip to content

Commit

Permalink
chore: replace husky with lefthook
Browse files Browse the repository at this point in the history
  • Loading branch information
omarluq committed Jan 31, 2024
1 parent 88f399a commit 30bcef2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ dist
dist-ssr
*.local
pnpm-lock.yaml
.husky/*
!.husky/.keep

# Editor directories and files
.vscode/*
Expand Down
Empty file added .husky/.keep
Empty file.
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ docs/coverage
*.yml
*.config.*
.chglog/
.husky/
17 changes: 17 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EXAMPLE USAGE:
#
# Refer for explanation to following link:
# https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md
#
pre-commit:
parallel: true
follow: true
commands:
biome-lint:
run: pnpm lint
biome-format:
run: pnpm format:check
commit-msg:
commands:
lint-commit-msg:
run: pnpm commitlint --edit
9 changes: 1 addition & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
"files": [
"dist/**/*"
],
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"scripts": {
"build": "rollup -c --bundleConfigAsCjs",
"test": "jest --reporters default jest-stare",
Expand All @@ -31,11 +26,9 @@
"format:write": "biome format --write .",
"code-size": "npx size-limit",
"changelog": "git-chglog -o docs/CHANGELOG.md",
"husky:prepare": "husky install",
"docs": "docsify serve docs",
"prepack": "cp docs/README.md . && cp docs/CHANGELOG.md . && cp docs/LICENSE.md . && cp -r dist/* .",
"postpack": "git clean -f -d"

},
"keywords": [
"stimulus",
Expand Down Expand Up @@ -68,10 +61,10 @@
"@types/jest": "^29.5.10",
"@types/node": "^20.10.0",
"all-contributors-cli": "^6.26.1",
"husky": "^9.0.7",
"jest": "^29.7.0",
"jest-junit": "^16.0.0",
"jest-stare": "^2.5.1",
"lefthook": "^1.6.1",
"rollup": "^4.5.1",
"rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-copy": "^3.5.0",
Expand Down

0 comments on commit 30bcef2

Please sign in to comment.