diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..c37466e --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx lint-staged \ No newline at end of file diff --git a/package.json b/package.json index 848cb53..3afe06f 100644 --- a/package.json +++ b/package.json @@ -35,11 +35,18 @@ "eslint-plugin-es": "^4.1.0", "eslint-plugin-html": "^7.1.0", "html-webpack-plugin": "^5.3.2", + "husky": "^8.0.3", "prettier": "^3.1.1", "style-loader": "^3.2.1", "url-loader": "^4.1.1", "webpack": "^5.51.1", "webpack-cli": "^4.9.1", "webpack-dev-server": "^4.3.1" + }, + "lint-staged": { + "*.{js,cjs,html}": [ + "eslint --cache --quiet", + "prettier --write --no-config" + ] } }