diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..6061942 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +bun x lint-staged diff --git a/bun.lockb b/bun.lockb index 814e242..2ed88d1 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index cab118c..3482fea 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,9 @@ "eslint": "8.57.1", "eslint-config-prettier": "9.1.2", "eslint-plugin-svelte": "2.46.1", + "husky": "^9.1.7", "jsdom": "^29.1.1", + "lint-staged": "^17.0.8", "postcss": "^8.4.38", "prettier": "~3.1.0", "prettier-plugin-svelte": "^4.1.1", @@ -41,7 +43,8 @@ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "lint": "prettier --check . && eslint .", - "format": "prettier --write ." + "format": "prettier --write .", + "prepare": "husky" }, "type": "module", "dependencies": { @@ -51,5 +54,14 @@ "marked": "^14.1.3", "svelte-material-icons": "^3.0.5", "tailwind-merge": "^2.2.2" + }, + "lint-staged": { + "*.{js,ts,cjs,mjs,svelte}": [ + "prettier --write", + "eslint" + ], + "*.{json,md,html,css}": [ + "prettier --write" + ] } }