Skip to content

Commit 758b3be

Browse files
committed
ci(*): add husky + lint-staged + prettier to reduce chance to meet test:format error
1 parent 4f168d7 commit 758b3be

File tree

4 files changed

+167
-1
lines changed

4 files changed

+167
-1
lines changed

.husky/pre-commit

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm lint-staged

.lintstagedrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"*": ["prettier --write"]
3+
}

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"scripts": {
1111
"clean": "pnpm --filter \"./packages/**\" run clean",
1212
"preinstall": "node -e \"if(process.env.CI == 'true') {console.log('Skipping preinstall...'); process.exit(1)}\" || npx -y only-allow pnpm",
13+
"prepare": "husky",
1314
"install:csb": "corepack enable && pnpm install --frozen-lockfile",
1415
"test": "pnpm run test:ci",
1516
"test:pr": "nx affected --targets=test:format,test:sherif,test:knip,test:eslint,test:lib,test:types,test:build,build",
@@ -59,8 +60,10 @@
5960
"eslint-plugin-import": "^2.29.1",
6061
"eslint-plugin-react": "^7.33.2",
6162
"eslint-plugin-react-hooks": "^4.6.0",
63+
"husky": "^9.0.11",
6264
"jsdom": "^24.0.0",
6365
"knip": "^4.6.0",
66+
"lint-staged": "^15.2.2",
6467
"nx": "17.3.1",
6568
"prettier": "^4.0.0-alpha.8",
6669
"prettier-plugin-svelte": "^3.1.2",

pnpm-lock.yaml

+160-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)