From bfe202fd09b8658ba99fcda7c84b385063f19a85 Mon Sep 17 00:00:00 2001 From: MichalKinas <113341662+MichalKinas@users.noreply.github.com> Date: Fri, 18 Nov 2022 10:52:44 +0100 Subject: [PATCH] [ACS-4014] Fix pre-commit hook for ACA (#2791) --- .husky/pre-commit | 4 ++++ .lintstagedrc.json | 4 ++++ package.json | 14 ++------------ 3 files changed, 10 insertions(+), 12 deletions(-) create mode 100755 .husky/pre-commit create mode 100644 .lintstagedrc.json diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 000000000..d24fdfc60 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npx lint-staged diff --git a/.lintstagedrc.json b/.lintstagedrc.json new file mode 100644 index 000000000..2f93c5033 --- /dev/null +++ b/.lintstagedrc.json @@ -0,0 +1,4 @@ +{ + "*.{ts, js, html}": ["prettier --single-quote --write", "eslint"], + "*.{css, scss}": ["prettier --single-quote --write"] +} diff --git a/package.json b/package.json index ee9e2d98d..20f25e0a4 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "e2e.typecheck": "tsc -p ./e2e/tsconfig.e2e.typecheck.json", "e2e": "npm run update-webdriver && protractor $SUITE", "spellcheck": "cspell '{src,e2e,projects}/**/*.ts'", - "inspect.bundle": "ng build content-ce --configuration production --stats-json && npx webpack-bundle-analyzer dist/content-ce/stats.json" + "inspect.bundle": "ng build content-ce --configuration production --stats-json && npx webpack-bundle-analyzer dist/content-ce/stats.json", + "prepare": "husky install" }, "private": true, "dependencies": { @@ -120,16 +121,5 @@ "typescript": "4.6.3", "webdriver-manager": "12.1.8", "winston": "^3.8.2" - }, - "lint-staged": { - "*.{ts,js,css,scss,html}": [ - "prettier --single-quote --write", - "git add" - ] - }, - "husky": { - "hooks": { - "pre-commit": "lint-staged" - } } }