Skip to content

Commit b0bd4a2

Browse files
committed
chore: add husky and lint-staged
1 parent a78ccf8 commit b0bd4a2

File tree

4 files changed

+302
-1
lines changed

4 files changed

+302
-1
lines changed

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
pnpm lint-staged

.lintstagedrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"*.{js,mjs,cjs,ts,tsx}": ["prettier --write", "eslint --fix"]
3+
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@
6363
"test-build": "pnpm test:code:build",
6464
"build": "pnpm clear-build && pnpm rollup --config rollup.config.cjs && cp index.d.ts reflect.d.ts",
6565
"clear-build": "rm -f index.* && rm -f reflect.* && rm -f ssr.* && rm -f scope.* && rm -rf dist && rm -rf core",
66-
"prepublishOnly": "pnpm build"
66+
"prepublishOnly": "pnpm build",
67+
"prepare": "husky install"
6768
},
6869
"devDependencies": {
6970
"@babel/core": "^7.12.7",
@@ -87,7 +88,9 @@
8788
"eslint": "^8.22.0",
8889
"eslint-kit": "^6.11.0",
8990
"fs-extra": "^9.0.1",
91+
"husky": "^8.0.3",
9092
"jest": "^26.6.3",
93+
"lint-staged": "^13.1.2",
9194
"prettier": "^2.2.0",
9295
"react": "^17.0.1",
9396
"react-dom": "^17.0.1",

0 commit comments

Comments
 (0)