Skip to content

Commit

Permalink
feat: 添加代码提交格式化
Browse files Browse the repository at this point in the history
  • Loading branch information
申远 committed Aug 31, 2021
1 parent 4757036 commit e4c5101
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 191 deletions.
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx commitlint -e $HUSKY_GIT_PARAMS
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint-staged
14 changes: 1 addition & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"scripts": {
"build": "rm -rf dist && npx rollup -c rollup.config.js",
"test": "jest --coverage --verbose -u",
"lint-staged": "npx eslint --fix"
"lint-staged": "npx eslint --fix src/**/*.ts"
},
"dependencies": {},
"devDependencies": {
Expand All @@ -33,17 +33,5 @@
"ts-jest": "^27.0.5",
"tslib": "^2.3.1",
"typescript": "^4.3.5"
},
"husky": {
"hooks": {
"pre-commit": "npm run lint-staged",
"commit-msg": "commitlint -e HUSKY_GIT_PARAMS"
}
},
"lint-staged": {
"src/**/*.ts": [
"npm run lint-staged",
"git add"
]
}
}
2 changes: 1 addition & 1 deletion src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ export class Test {
}
}
interface Foo {
test(): string;
test: () => string;
}
Loading

0 comments on commit e4c5101

Please sign in to comment.