Skip to content

Commit

Permalink
build: add commitlint, prettier & standard-version
Browse files Browse the repository at this point in the history
  • Loading branch information
zjr committed May 28, 2019
1 parent c8f3053 commit 252f071
Show file tree
Hide file tree
Showing 4 changed files with 2,137 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
18 changes: 18 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
rules: {
'type-enum': [
2,
'always',
['build', 'ci', 'chore', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test']
],
'scope-enum': [2, 'always', ['release']],
'body-leading-blank': [1, 'always'],
'footer-leading-blank': [1, 'always'],
'header-max-length': [2, 'always', 72],
'scope-case': [2, 'always', 'lower-case'],
'subject-empty': [2, 'never'],
'type-case': [2, 'always', 'lower-case'],
'type-empty': [2, 'never']
}
};

18 changes: 16 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
"description": "Response & Error Handler for Koa",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"release": "standard-version"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"repository": {
"type": "git",
Expand All @@ -20,5 +27,12 @@
"bugs": {
"url": "https://github.com/zjr/harald/issues"
},
"homepage": "https://github.com/zjr/harald#readme"
"homepage": "https://github.com/zjr/harald#readme",
"devDependencies": {
"@commitlint/cli": "^7.6.1",
"husky": "^2.3.0",
"prettier": "^1.17.1",
"pretty-quick": "^1.11.0",
"standard-version": "^6.0.1"
}
}
Loading

0 comments on commit 252f071

Please sign in to comment.