Skip to content

Commit 3c85ece

Browse files
dx: auto-sync home.md from readme.md via lint-staged
- Add .lintstagedrc.cjs with function syntax to run update-readme whenever README.md is committed, then auto-stage home.md - Move lint-staged config out of package.json (functions require .cjs) - Remove update-readme from postinstall (no longer needed there) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 09fcb42 commit 3c85ece

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

.lintstagedrc.cjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
'*.{ts,js}': 'eslint --cache --cache-location=.husky/_ --fix',
3+
'*.{ts,js,css,scss,md,mdx}': 'prettier --write',
4+
'README.md': () => [
5+
'pnpm nx run web-app:update-readme',
6+
'git add apps/web-app/src/assets/home.md',
7+
],
8+
};

package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"dotnet:build": "dotnet build apps/api",
5050
"dotnet:update": "dotnet outdated -u apps/api",
5151
"preinstall": "pnpm dotnet:restore",
52-
"postinstall": "pnpm build:dotnet-builder && pnpm update-readme",
52+
"postinstall": "pnpm build:dotnet-builder",
5353
"prepare": "husky",
5454
"update-packages": "ts-node ./tools/update-packages/src/main.ts"
5555
},
@@ -138,9 +138,5 @@
138138
"typescript-eslint": "8.57.0",
139139
"vite": "8.0.0",
140140
"vitest": "4.1.0"
141-
},
142-
"lint-staged": {
143-
"*.{ts,js}": "eslint --cache --cache-location=.husky/_ --fix",
144-
"*.{ts,js,css,scss,md,mdx}": "prettier --write"
145141
}
146142
}

0 commit comments

Comments
 (0)