From ec18c0cb83cb92cd0d9324c7a6ddb75d0fdfdede Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 9 Oct 2024 10:19:56 +0800 Subject: [PATCH] chore: add commitlint and husky and lint-staged --- .commitlintrc.js | 1 + .husky/pre-commit | 1 + .lintstagedrc | 3 +++ commitlint.config.js | 1 - package.json | 4 ++-- 5 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 .commitlintrc.js create mode 100644 .husky/pre-commit create mode 100644 .lintstagedrc delete mode 100644 commitlint.config.js diff --git a/.commitlintrc.js b/.commitlintrc.js new file mode 100644 index 00000000..422b1944 --- /dev/null +++ b/.commitlintrc.js @@ -0,0 +1 @@ +module.exports = { extends: ['@commitlint/config-conventional'] }; 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/.lintstagedrc b/.lintstagedrc new file mode 100644 index 00000000..d0bf80e1 --- /dev/null +++ b/.lintstagedrc @@ -0,0 +1,3 @@ +{ + "*": "prettier --ignore-unknown --write" +} diff --git a/commitlint.config.js b/commitlint.config.js deleted file mode 100644 index 3f5e287f..00000000 --- a/commitlint.config.js +++ /dev/null @@ -1 +0,0 @@ -export default { extends: ['@commitlint/config-conventional'] }; diff --git a/package.json b/package.json index 1eda866b..26400e0d 100644 --- a/package.json +++ b/package.json @@ -79,9 +79,9 @@ "husky": "^9.1.6", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", - "lint-staged": "^10.5.4", + "lint-staged": "^15.2.10", "mockjs": "^1.1.0", - "prettier": "^2.8.8", + "prettier": "^3.3.3", "react-dev-inspector": "^1.9.0", "swagger-ui-dist": "^4.19.1", "ts-node": "^10.9.2",