Added husky

This commit is contained in:
MaxOvs19 2023-05-31 11:32:36 +03:00
parent 9e242ddf5d
commit 2c7c5c7d5c
2 changed files with 9 additions and 2 deletions

5
.husky/pre-commit Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npm run format
npm run lint

View File

@ -74,14 +74,16 @@
"webpack-bundle-analyzer": "4.7.0",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "4.11.1",
"webpack-merge": "5.8.0"
"webpack-merge": "5.8.0",
"husky": "^8.0.0"
},
"scripts": {
"build": "cross-env SERVE=true webpack -c config/webpack/prod.js",
"start": "webpack serve -c config/webpack/dev.js",
"analyze": "webpack --analyze -c config/webpack/analyze.js",
"format": "prettier --write \"./**/*.{js,jsx}\"",
"lint": "npx eslint 'src/**/*.{js,jsx,ts,tsx}'"
"lint": "npx eslint 'src/**/*.{js,jsx,ts,tsx}'",
"prepare": "husky install"
},
"eslintConfig": {
"extends": [