chore: add husky + lint-staged + commitlint for commit quality control
This commit is contained in:
1
.husky/commit-msg
Normal file
1
.husky/commit-msg
Normal file
@@ -0,0 +1 @@
|
||||
npx --no-install commitlint --edit $1
|
||||
1
.husky/pre-commit
Normal file
1
.husky/pre-commit
Normal file
@@ -0,0 +1 @@
|
||||
npx lint-staged
|
||||
24
commitlint.config.mjs
Normal file
24
commitlint.config.mjs
Normal file
@@ -0,0 +1,24 @@
|
||||
export default {
|
||||
extends: ["@commitlint/config-conventional"],
|
||||
rules: {
|
||||
"type-enum": [
|
||||
2,
|
||||
"always",
|
||||
[
|
||||
"feat",
|
||||
"fix",
|
||||
"docs",
|
||||
"style",
|
||||
"refactor",
|
||||
"test",
|
||||
"chore",
|
||||
"perf",
|
||||
"ci",
|
||||
"build",
|
||||
"revert",
|
||||
],
|
||||
],
|
||||
"subject-case": [0],
|
||||
"header-max-length": [2, "always", 120],
|
||||
},
|
||||
}
|
||||
1368
package-lock.json
generated
1368
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
20
package.json
20
package.json
@@ -40,8 +40,22 @@
|
||||
"dr:failover": "bash scripts/failover.sh",
|
||||
"arch:scan": "tsx scripts/arch-scan/cli.ts scan",
|
||||
"arch:query": "tsx scripts/arch-scan/cli.ts query",
|
||||
"test:arch-scan": "vitest run --config vitest.arch-scan.config.ts"
|
||||
"test:arch-scan": "vitest run --config vitest.arch-scan.config.ts",
|
||||
"prepare": "husky"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{ts,tsx}": [
|
||||
"eslint --fix",
|
||||
"prettier --write"
|
||||
],
|
||||
"*.{json,md,css,mjs}": [
|
||||
"prettier --write"
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
},
|
||||
"packageManager": "npm@10.8.2",
|
||||
"dependencies": {
|
||||
"@alicloud/credentials": "^2.4.5",
|
||||
"@alicloud/dysmsapi20170525": "^4.5.1",
|
||||
@@ -117,6 +131,8 @@
|
||||
"zustand": "^5.0.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^21.2.0",
|
||||
"@commitlint/config-conventional": "^21.2.0",
|
||||
"@faker-js/faker": "^10.1.0",
|
||||
"@playwright/test": "^1.58.2",
|
||||
"@tailwindcss/postcss": "^4",
|
||||
@@ -137,7 +153,9 @@
|
||||
"drizzle-kit": "^0.31.8",
|
||||
"eslint": "^9",
|
||||
"eslint-config-next": "16.0.10",
|
||||
"husky": "^9.1.7",
|
||||
"jsdom": "^29.1.1",
|
||||
"lint-staged": "^16.4.0",
|
||||
"pino-pretty": "^11.3.0",
|
||||
"prettier": "^3.7.4",
|
||||
"prettier-plugin-tailwindcss": "^0.7.2",
|
||||
|
||||
Reference in New Issue
Block a user