diff --git a/.git-hooks/pre-commit b/.git-hooks/pre-commit index bd9faed..2aa6dae 100644 --- a/.git-hooks/pre-commit +++ b/.git-hooks/pre-commit @@ -8,6 +8,6 @@ if [[ "$BRANCH" =~ $REGEX ]]; then echo "You are on branch $BRANCH. Are you sure you want to commit to this branch?" echo "If so, commit with -n to bypass the pre-commit hook." exit 1 -else - npm run lint-staged fi + +npm run lint-staged diff --git a/package.json b/package.json index cecb839..6fabe5b 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,10 @@ "build": "tsc && vite build", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "lint:fix": "eslint . --fix --ext ts,tsx --report-unused-disable-directives --max-warnings 0", + "lint:staged": "eslint --fix --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "formatter:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"", "formatter:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\"", + "formatter:staged": "prettier --write --ignore-unknown", "preview": "vite preview", "preinstall": "git config core.hooksPath .git-hooks", "license-checker": "node licenseChecker.cjs", @@ -74,8 +76,8 @@ }, "lint-staged": { "*.{js,jsx,ts,tsx}": [ - "eslint . --ext ts,tsx --report-unused-disable-directives --quiet --max-warnings 0 --fix" + "npm run lint:staged" ], - "**/*": "prettier . --write --ignore-unknown" + "*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}": "npm run formatter:staged" } }