diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f10f0c1ae..f9ff60ef3 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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 diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100644 index 5cb81a83b..000000000 --- a/.husky/pre-commit +++ /dev/null @@ -1 +0,0 @@ -bun run pre-commit diff --git a/bun.lockb b/bun.lockb index cf9e67cac..52dc9cd11 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/eslint.config.js b/eslint.config.js index 0e735baf3..f4b573df8 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -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, diff --git a/lefthook.yml b/lefthook.yml new file mode 100644 index 000000000..f08e1f097 --- /dev/null +++ b/lefthook.yml @@ -0,0 +1,6 @@ +pre-commit: + parallel: true + commands: + lint: + glob: "*.{js,jsx,ts,tsx}" + run: bun lint {staged_files} diff --git a/package.json b/package.json index 3f8321fc0..0de374e7a 100644 --- a/package.json +++ b/package.json @@ -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": "bun@1.1.43", @@ -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)", @@ -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",