From af85858ca675c1deae46d09d6556a4a943b8bc2f Mon Sep 17 00:00:00 2001 From: Jordan Jensen Date: Tue, 26 Mar 2024 16:01:21 -0700 Subject: [PATCH] Run prettier --write on staged files --- .husky/pre-commit | 5 ++++- package.json | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 9e97d326d..a16d8b1d5 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1,4 @@ -# npm run check-format +#!/usr/bin/env sh +. "$(dirname "$0")/_/husky.sh" + +npx lint-staged diff --git a/package.json b/package.json index a535b90f7..96f17f499 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,11 @@ "check-format": "prettier . --check", "prepare": "husky" }, + "lint-staged": { + "*": [ + "prettier --write --ignore-unknown" + ] + }, "devDependencies": { "husky": "^9.0.11", "lint-staged": "^15.2.2",