From d43067f70ebb5d52c08452402540406ca9ff4cfa Mon Sep 17 00:00:00 2001 From: enes Date: Tue, 6 Aug 2024 17:17:39 +0200 Subject: [PATCH] fix(ci): run lint-staged always, fix lint-stage commands --- .git-hooks/pre-commit | 4 ++-- package.json | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) 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" } }