Skip to content

Commit e8d614e

Browse files
committed
chore: Configure conventional commits
1 parent 8b616c3 commit e8d614e

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

commitlint.config.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
'use strict';
2+
3+
module.exports = {
4+
rules: {
5+
'body-leading-blank': [2, 'always'],
6+
'body-max-line-length': [2, 'always', 72],
7+
'footer-leading-blank': [2, 'always'],
8+
'footer-max-line-length': [2, 'always', 72],
9+
'header-max-length': [2, 'always', 72],
10+
'scope-case': [2, 'always', 'start-case'],
11+
'scope-enum': [2, 'always', ['']],
12+
'subject-case': [2, 'always', 'sentence-case'],
13+
'subject-empty': [2, 'never'],
14+
'subject-full-stop': [2, 'never', '.'],
15+
'type-case': [2, 'always', 'lower-case'],
16+
'type-empty': [2, 'never'],
17+
'type-enum': [
18+
2,
19+
'always',
20+
['build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'style', 'test'],
21+
],
22+
},
23+
};

package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
"prettier -c"
3333
]
3434
},
35+
"standard-version": {
36+
"skip": {
37+
"commit": true,
38+
"tag": true
39+
}
40+
},
3541
"dependencies": {
3642
"async": "^2.6.3",
3743
"bluebird": "^3.7.2",
@@ -41,6 +47,7 @@
4147
"lodash": "^4.17.15"
4248
},
4349
"devDependencies": {
50+
"@commitlint/cli": "^8.3.5",
4451
"@serverless/eslint-config": "^1.2.1",
4552
"coveralls": "^3.0.9",
4653
"eslint": "^6.8.0",
@@ -50,12 +57,16 @@
5057
"jest": "^24.9.0",
5158
"lint-staged": "^10.0.8",
5259
"prettier": "^1.19.1",
53-
"sinon": "^7.5.0"
60+
"sinon": "^7.5.0",
61+
"standard-version": "^7.1.0"
5462
},
5563
"scripts": {
64+
"commitlint": "commitlint -f HEAD@{15}",
65+
"commitlint:pull-request": "commitlint -f HEAD~1",
5666
"coverage": "jest --coverage",
5767
"lint": "eslint . --cache",
5868
"lint:updated": "pipe-git-updated --ext=js -- eslint --cache",
69+
"prepare-release": "standard-version && prettier --write CHANGELOG.md",
5970
"prettier-check": "prettier -c --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml}\"",
6071
"prettier-check:updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier -c",
6172
"prettify": "prettier --write --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml}\"",

0 commit comments

Comments
 (0)