Skip to content

Commit

Permalink
Merge pull request #392 from 18003228289/husky
Browse files Browse the repository at this point in the history
feat: add commit lint and husky
  • Loading branch information
chickenlj authored Apr 25, 2024
2 parents 87b17bf + a7ee4d7 commit b9d8eb5
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 6 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 --no-install commitlint --edit $1
32 changes: 32 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'body-leading-blank': [2, 'always'],
'footer-leading-blank': [1, 'always'],
'header-max-length': [2, 'always', 108],
'subject-empty': [2, 'never'],
'type-empty': [2, 'never'],
'subject-case': [0],
'type-enum': [
2,
'always',
[
'feat',
'fix',
'perf',
'style',
'docs',
'test',
'refactor',
'build',
'ci',
'chore',
'revert',
'wip',
'workflow',
'types',
'release',
],
],
},
}
2 changes: 1 addition & 1 deletion example/dubbo-node-example/package-lock.json

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

2 changes: 1 addition & 1 deletion example/dubbo-web-example/package-lock.json

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

12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"private": true,
"name": "dubbo-js-private-workspace",
"scripts": {
"prepare": "husky install"
},
"workspaces": [
"./packages/dubbo",
"./packages/protoc-gen-apache-dubbo-es",
Expand All @@ -18,19 +21,20 @@
"node": ">=16",
"npm": ">=8"
},
"type": "module",
"engineStrict": true,
"devDependencies": {
"husky": "^6.0.0",
"@commitlint/cli": "^19.2.1",
"@commitlint/config-conventional": "^19.1.0",
"@types/node": "^20.4.0",
"@typescript-eslint/eslint-plugin": "^5.59.1",
"@typescript-eslint/parser": "^5.59.2",
"eslint": "^8.39.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"husky": "^6.0.0",
"prettier": "^2.8.8",
"typescript": "5.0.3",
"@types/node": "^20.4.0"
"typescript": "5.0.3"
},
"license": "Apache-2.0"
}

0 comments on commit b9d8eb5

Please sign in to comment.