From a898f5db36b91a2943101618e46119ccf21bb86e Mon Sep 17 00:00:00 2001 From: Ayo Ayco Date: Fri, 27 Dec 2024 17:13:11 +0100 Subject: [PATCH] chore: test format on precommit --- .husky/.gitignore | 1 + .husky/pre-commit | 3 ++- package.json | 8 ++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 .husky/.gitignore diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 0000000..31354ec --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit index 0ad376d..61c8331 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1,2 @@ -npm run check +npx lint-staged +npx lint-staged diff --git a/package.json b/package.json index d4b74ae..503d4e7 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "build:preview": "astro build && astro preview", "deploy": "astro build && scp -r dist ayo@ayco.io:~/ayco.io-flask/", "copy:dist": "astro build && cp -R dist ../ayco.io-flask/", - "prepare": "husky" + "prepare": "husky && husky install" }, "devDependencies": { "@astro-reactive/form": "^0.10.0", @@ -38,5 +38,9 @@ "prettier-plugin-astro": "^0.14.1", "typescript-eslint": "^8.18.2" }, - "packageManager": "pnpm@9.15.0+sha512.76e2379760a4328ec4415815bcd6628dee727af3779aaa4c914e3944156c4299921a89f976381ee107d41f12cfa4b66681ca9c718f0668fa0831ed4c6d8ba56c" + "packageManager": "pnpm@9.15.0+sha512.76e2379760a4328ec4415815bcd6628dee727af3779aaa4c914e3944156c4299921a89f976381ee107d41f12cfa4b66681ca9c718f0668fa0831ed4c6d8ba56c", + "lint-staged": { + "*.js": "eslint --cache --fix", + "*.--write": "prettier --write" + } }