Skip to content

Commit

Permalink
dx: replace husky with lefthook (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
incognitojam authored Jan 10, 2025
1 parent 63b31c1 commit bd7c34b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- run: bun install --frozen-lockfile
- run: bun playwright install
- run: timeout 12s bun pre-commit
- run: timeout 12s bun lefthook run pre-commit
- run: bun run test
- run: ./check-lines.sh
- name: Bundle size breakdown
Expand Down
1 change: 0 additions & 1 deletion .husky/pre-commit

This file was deleted.

Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default [
languageOptions: { globals: globals.browser },
},
{
ignores: ['.github', '.husky', '.vscode', 'node_modules', 'dist'],
ignores: ['.github', '.vscode', 'dist'],
},
js.configs.recommended,
...ts.configs.recommendedTypeChecked,
Expand Down
6 changes: 6 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pre-commit:
parallel: true
commands:
lint:
glob: "*.{js,jsx,ts,tsx}"
run: bun lint {staged_files}
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
"dev": "vite",
"serve": "vite prefix",
"lint": "eslint --cache --cache-location node_modules/.eslintcache",
"prepare": "husky",
"pre-commit": "bun lint",
"test": "vitest run"
},
"packageManager": "[email protected]",
Expand All @@ -33,8 +31,8 @@
"eslint-plugin-solid": "ESLint rules specific to solid",
"eslint-plugin-tailwindcss": "ESLint rules specific to tailwind",
"globals": "defines global identifiers for ESLint",
"husky": "git hooks tool, used here for pre-commit linting",
"jsdom": "js implementation of the dom (used in testing env which we don't really make use of)",
"lefthook": "git hooks manager for pre-commit",
"playwright": "take screenshots to post on PRs",
"postcss": "transforms css with js; autoprefixer and tailwind get plugged into this",
"solid-devtools": "visualize reactivity graph (consider if necessary)",
Expand All @@ -60,8 +58,8 @@
"eslint-plugin-solid": "^0.14.5",
"eslint-plugin-tailwindcss": "^3.17.5",
"globals": "^15.14.0",
"husky": "^9.1.7",
"jsdom": "^26.0.0",
"lefthook": "^1.10.3",
"playwright": "^1.49.1",
"postcss": "^8.4.49",
"solid-devtools": "^0.33.0",
Expand Down

0 comments on commit bd7c34b

Please sign in to comment.