Skip to content

Commit 4bcaf66

Browse files
committed
chore: add commitlint to check commit msg
1 parent c759f44 commit 4bcaf66

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

package.json

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
"build": "NODE_ENV=production webpack -p --progress --hide-modules",
1919
"lint": "eslint --ext .js,.vue src",
2020
"test": "BABEL_ENV=test karma start",
21+
"precommit": "npm run lint",
22+
"commitmsg": "commitlint -E GIT_PARAMS",
2123
"release": "bash ./release.sh"
2224
},
2325
"keywords": [
@@ -36,6 +38,8 @@
3638
},
3739
"homepage": "https://github.com/PeachScript/vue-infinite-loading",
3840
"devDependencies": {
41+
"@commitlint/cli": "^7.0.0",
42+
"@commitlint/config-conventional": "^7.0.1",
3943
"autoprefixer": "^7.1.2",
4044
"babel-core": "^6.25.0",
4145
"babel-eslint": "^7.2.3",
@@ -54,6 +58,7 @@
5458
"eslint-plugin-html": "^3.2.0",
5559
"eslint-plugin-import": "^2.7.0",
5660
"html-webpack-plugin": "^2.30.1",
61+
"husky": "^0.14.3",
5762
"karma": "^1.7.0",
5863
"karma-chai": "^0.1.0",
5964
"karma-coverage": "^1.1.1",
@@ -66,7 +71,6 @@
6671
"less-loader": "^4.0.5",
6772
"mocha": "^3.5.0",
6873
"phantomjs-prebuilt": "^2.1.15",
69-
"pre-commit": "^1.2.2",
7074
"sinon": "^2.4.1",
7175
"sinon-chai": "^2.13.0",
7276
"style-loader": "^0.18.2",
@@ -81,13 +85,27 @@
8185
"vue": "^2.2.0"
8286
},
8387
"license": "MIT",
84-
"pre-commit": [
85-
"lint"
86-
],
8788
"browserslist": [
8889
"> 1%",
8990
"last 1 versions",
9091
"last 4 Android versions",
9192
"last 3 iOS versions"
92-
]
93+
],
94+
"commitlint": {
95+
"extends": [
96+
"@commitlint/config-conventional"
97+
],
98+
"rules": {
99+
"scope-enum": [
100+
2,
101+
"always",
102+
[
103+
"core",
104+
"config",
105+
"spinner",
106+
"deps"
107+
]
108+
]
109+
}
110+
}
93111
}

0 commit comments

Comments
 (0)