chore: configure local quality gates per ADR-0007
Wire Husky 9 + lint-staged + commitlint with @commitlint/config-
conventional - the local pair of git hooks defined in ADR-0007.
- package.json declares the prepare script ('husky') so the hooks
install on every fresh pnpm install (no manual step).
- .husky/pre-commit runs 'pnpm exec lint-staged' which formats staged
files via prettier (lint and tests stay in CI per ADR-0015 to keep
commits fast).
- .husky/commit-msg runs 'pnpm exec commitlint --edit "$1"' to enforce
Conventional Commits at commit time. Same check is repeated in CI
for defense in depth.
- commitlint.config.cjs at the workspace root extends @commitlint
/config-conventional.
- lint-staged config in package.json restricts to ts/tsx/js/jsx/html/
scss/css/md/json/yml/yaml under prettier --write.
Verified: a 'feat: ...' commit message is accepted; a message without
a Conventional Commits type is rejected.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
pnpm exec commitlint --edit "$1"
|
||||
@@ -0,0 +1 @@
|
||||
pnpm exec lint-staged
|
||||
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Commitlint configuration — Conventional Commits.
|
||||
* See ADR-0007 for rationale.
|
||||
*/
|
||||
module.exports = {
|
||||
extends: ['@commitlint/config-conventional'],
|
||||
};
|
||||
+12
-1
@@ -2,8 +2,15 @@
|
||||
"name": "apf-portal",
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"scripts": {},
|
||||
"scripts": {
|
||||
"prepare": "husky"
|
||||
},
|
||||
"private": true,
|
||||
"lint-staged": {
|
||||
"*.{ts,tsx,js,jsx,html,scss,css,md,json,yml,yaml}": [
|
||||
"prettier --write"
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@analogjs/vite-plugin-angular": "~2.1.2",
|
||||
"@analogjs/vitest-angular": "~2.1.2",
|
||||
@@ -13,6 +20,8 @@
|
||||
"@angular/cli": "~21.2.0",
|
||||
"@angular/compiler-cli": "~21.2.0",
|
||||
"@angular/language-service": "~21.2.0",
|
||||
"@commitlint/cli": "^20.5.3",
|
||||
"@commitlint/config-conventional": "^20.5.3",
|
||||
"@eslint/js": "^9.8.0",
|
||||
"@nestjs/schematics": "^11.0.0",
|
||||
"@nestjs/testing": "^11.0.0",
|
||||
@@ -44,11 +53,13 @@
|
||||
"eslint": "^9.8.0",
|
||||
"eslint-config-prettier": "^10.0.0",
|
||||
"eslint-plugin-playwright": "^1.6.2",
|
||||
"husky": "^9.1.7",
|
||||
"jest": "^30.0.2",
|
||||
"jest-environment-node": "^30.0.2",
|
||||
"jest-util": "^30.0.2",
|
||||
"jsdom": "^27.1.0",
|
||||
"jsonc-eslint-parser": "^2.1.0",
|
||||
"lint-staged": "^16.4.0",
|
||||
"nx": "22.7.0",
|
||||
"prettier": "^3.8.1",
|
||||
"prisma": "^7.8.0",
|
||||
|
||||
Generated
+8958
-2943
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user