From b0d51c5efabc0ae189e58d7fdd52b437c731c618 Mon Sep 17 00:00:00 2001 From: Subir Date: Fri, 6 May 2022 18:59:24 +0530 Subject: [PATCH] chore(dev): updated precommit hook --- .husky/pre-commit | 1 - .nano-staged.mjs | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 5e71a65..c0f9775 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,5 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -yarn format --list-different yarn nano-staged diff --git a/.nano-staged.mjs b/.nano-staged.mjs index bea44c5..24a5064 100644 --- a/.nano-staged.mjs +++ b/.nano-staged.mjs @@ -17,8 +17,8 @@ import { resolve, sep } from "path"; export default { - // eslint - "*.{js,ts,tsx}": "eslint --cache --fix", + // format + "*.{js,ts,tsx}": ["yarn format", "yarn license", "eslint --cache --fix"], /** * Run typechecking if any type-sensitive files was staged @@ -30,7 +30,7 @@ export default { return Array.from( filenames.reduce((set, filename) => { const pack = filename.replace(pathToPackages, "").split(sep)[0]; - set.add(`npm run typecheck:${pack} --if-present`); + set.add(`yarn typecheck:${pack} --if-present`); return set; }, new Set()) );