diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 00000000..c27d8893 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +lint-staged diff --git a/package.json b/package.json index 2d425c7f..d5c24d10 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,8 @@ "prepublishOnly": "npm run compile && np --yolo --no-publish", "postpublish": "tnpm sync rc-menu", "start": "dumi dev", - "test": "rc-test" + "test": "rc-test", + "prepare": "husky && dumi setup" }, "dependencies": { "@babel/runtime": "^7.10.1", @@ -66,7 +67,9 @@ "eslint-plugin-unicorn": "^51.0.1", "father": "^4.0.0", "gh-pages": "^6.1.0", + "husky": "^9.1.6", "less": "^4.1.3", + "lint-staged": "^15.2.10", "np": "^10.0.5", "rc-test": "^7.0.14", "react": "^18.3.1", @@ -77,5 +80,8 @@ "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" + }, + "lint-staged": { + "*": "prettier --write --ignore-unknown" } }