Skip to content

Commit

Permalink
config: Add pre-commit hook by husky and lint-staged
Browse files Browse the repository at this point in the history
  • Loading branch information
dengfuping committed Oct 25, 2023
1 parent 936583f commit f97fa4c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install lint-staged
16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"ci": "npm run tsc && npm run build && npm run lint && npm run test",
"deploy": "npm run site:build && npm run site:deploy",
"dev": "tsc --skipLibCheck packages/design/src/theme/index.ts --outDir ./.dumi/tmp/plugin-theme-less && cross-env UMI_ENV=theme dumi dev",
"prepare": "dumi setup",
"prepare": "husky install && dumi setup",
"prepublishOnly": "npm run build",
"publish": "lerna publish",
"publish:from-package": "lerna publish from-package",
Expand All @@ -30,11 +30,11 @@
"locale:remove-useless": "ts-node scripts/remove-useless-locale.ts"
},
"lint-staged": {
"*.{js,jsx,less,md,json}": [
"prettier --write"
"*.{js,jsx,ts,tsx}": [
"eslint"
],
"*.ts?(x)": [
"prettier --parser=typescript --write"
"*.{js,jsx,ts,tsx,less,md,json}": [
"prettier --write"
]
},
"devDependencies": {
Expand All @@ -43,12 +43,12 @@
"@ant-design/icons": "^5.2.6",
"@babel/cli": "^7.23.0",
"@babel/preset-env": "^7.23.2",
"@chenshuai2144/less2cssinjs": "^1.0.7",
"@ctrl/tinycolor": "^4.0.2",
"@emotion/babel-preset-css-prop": "^11.11.0",
"@emotion/css": "^11.11.2",
"@emotion/react": "^11.11.1",
"@emotion/server": "^11.11.0",
"@chenshuai2144/less2cssinjs": "^1.0.7",
"@qixian.cs/github-contributors-list": "^1.1.0",
"@stackblitz/sdk": "^1.9.0",
"@testing-library/dom": "^9.3.3",
Expand Down Expand Up @@ -78,6 +78,7 @@
"fs-extra": "^11.1.1",
"gh-pages": "^6.0.0",
"html2sketch": "^1.0.2",
"husky": "^8.0.3",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.7.0",
"jest-canvas-mock": "^2.5.2",
Expand Down Expand Up @@ -116,8 +117,5 @@
"yorkie": "^2.0.0"
},
"packageManager": "[email protected]",
"gitHooks": {
"pre-commit": "lint-staged"
},
"repository": "[email protected]:oceanbase/oceanbase-design.git"
}
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f97fa4c

Please sign in to comment.