From 3b91ef6474c45be3529bd7650949e78f32303326 Mon Sep 17 00:00:00 2001 From: jinhojang6 Date: Wed, 19 Apr 2023 21:15:21 +0900 Subject: [PATCH] configure husky and lint-staged --- .husky/pre-commit | 4 ++++ package.json | 11 +++++------ 2 files changed, 9 insertions(+), 6 deletions(-) create mode 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..d24fdfc --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npx lint-staged diff --git a/package.json b/package.json index 86a1b33..ab995d8 100644 --- a/package.json +++ b/package.json @@ -6,14 +6,13 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "next lint" + "lint": "next lint", + "prepare": "husky install" }, "lint-staged": { - "src/**/*.{ts,tsx}": [ - "eslint --ext .tsx,ts src/ --fix" - ], - "src/**": [ - "prettier --check 'src/**/*.ts' 'src/**/*.tsx'" + "*.{ts,tsx}": [ + "prettier --write", + "eslint --fix" ] }, "husky": {