diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000000..9eeb960e49 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npx lint-staged -q || node -e '' diff --git a/package-lock.json b/package-lock.json index f12430ac3a..8de1f0dc20 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,7 +44,7 @@ "gulp-postcss": "^8.0.0", "gulp-rename": "^1.4.0", "gulp-sass": "^5.1.0", - "husky": "^8.0.3", + "husky": "^9.1.7", "lint-staged": "^13.2.1", "normalize.css": "^5.0.0", "postcss-import": "^12.0.1", @@ -5306,15 +5306,16 @@ } }, "node_modules/husky": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", - "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", + "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", "dev": true, + "license": "MIT", "bin": { - "husky": "lib/bin.js" + "husky": "bin.js" }, "engines": { - "node": ">=14" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/typicode" diff --git a/package.json b/package.json index f2b49f242c..64cf8905b5 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "test": "echo \"Error: no test specified\" && exit 1", "clean": "echo \"Error: no clean specified\" && exit 1", "build": "gulp", - "start": "gulp start" + "start": "gulp start", + "prepare": "husky" }, "repository": { "type": "git", @@ -24,14 +25,9 @@ "homepage": "https://www.ec-cube.net/", "lint-staged": { "*.php": [ - "cross-env vendor/bin/php-cs-fixer --config=.php_cs.dist --path-mode=intersection fix" + "cross-env vendor/bin/php-cs-fixer --config=.php-cs-fixer.dist.php --path-mode=intersection fix" ] }, - "husky": { - "hooks": { - "pre-commit": "lint-staged 2>&1 | echo || node -e ''" - } - }, "dependencies": { "@babel/polyfill": "^7.12.1", "@popperjs/core": "^2.11.8", @@ -68,7 +64,7 @@ "gulp-postcss": "^8.0.0", "gulp-rename": "^1.4.0", "gulp-sass": "^5.1.0", - "husky": "^8.0.3", + "husky": "^9.1.7", "lint-staged": "^13.2.1", "normalize.css": "^5.0.0", "postcss-import": "^12.0.1",