Skip to content
This repository was archived by the owner on Aug 16, 2024. It is now read-only.

Commit 2838bc7

Browse files
committed
chore: add commentlint, husky, changelog
1 parent 7936939 commit 2838bc7

File tree

3 files changed

+1146
-42
lines changed

3 files changed

+1146
-42
lines changed

.commitlintrc.json

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"extends": ["@commitlint/config-angular"],
3+
"rules": {
4+
"subject-case": [
5+
1,
6+
"always",
7+
[
8+
"sentence-case",
9+
"start-case",
10+
"pascal-case",
11+
"upper-case",
12+
"lower-case",
13+
"camel-case"
14+
]
15+
],
16+
"type-enum": [
17+
2,
18+
"always",
19+
[
20+
"build",
21+
"chore",
22+
"ci",
23+
"docs",
24+
"feat",
25+
"fix",
26+
"perf",
27+
"refactor",
28+
"revert",
29+
"style",
30+
"test",
31+
"sample"
32+
]
33+
]
34+
}
35+
}

package.json

+20-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
"build": "cross-env NODE_ENV=production webpack",
1313
"release": "run-s build && sh scripts/build.sh",
1414
"prettier": "prettier --write '**/*.{js,jsx,ts,tsx,css,html}'",
15-
"lint": "eslint --ext .ts,.tsx,.js,.jsx"
15+
"lint": "eslint --ext .ts,.tsx,.js,.jsx",
16+
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
17+
"version": "npm run changelog && git add ."
1618
},
1719
"dependencies": {
1820
"@babel/core": "^7.12.10",
@@ -21,6 +23,8 @@
2123
"@babel/preset-env": "^7.12.10",
2224
"@babel/preset-react": "^7.12.10",
2325
"@babel/preset-typescript": "^7.12.7",
26+
"@commitlint/cli": "^11.0.0",
27+
"@commitlint/config-angular": "^11.0.0",
2428
"@emotion/babel-plugin": "^11.1.2",
2529
"@emotion/babel-plugin-jsx-pragmatic": "^0.1.5",
2630
"@emotion/css": "^11.1.3",
@@ -53,6 +57,7 @@
5357
"clean-webpack-plugin": "^3.0.0",
5458
"clsx": "^1.1.1",
5559
"connect.io": "^3.1.3",
60+
"conventional-changelog-cli": "^2.1.1",
5661
"copy-webpack-plugin": "^6.4.0",
5762
"cross-env": "^7.0.3",
5863
"css-loader": "^5.0.1",
@@ -65,6 +70,8 @@
6570
"fs-extra": "^9.0.1",
6671
"html-loader": "^1.3.2",
6772
"html-webpack-plugin": "^5.0.0-alpha.15",
73+
"husky": "^4.3.6",
74+
"lint-staged": "^10.5.3",
6875
"lodash-es": "^4.17.20",
6976
"mini-css-extract-plugin": "^1.3.3",
7077
"node-sass": "^5.0.0",
@@ -96,5 +103,17 @@
96103
"webpack": "^5.10.1",
97104
"webpack-cli": "^4.2.0",
98105
"webpack-dev-server": "^3.11.0"
106+
},
107+
"husky": {
108+
"hooks": {
109+
"pre-commit": "lint-staged",
110+
"commit-msg": "commitlint -c .commitlintrc.json -E HUSKY_GIT_PARAMS"
111+
}
112+
},
113+
"lint-staged": {
114+
"*.js": "eslint",
115+
"*.jsx": "eslint",
116+
"*.ts": "eslint --ext .ts",
117+
"*.tsx": "eslint --ext .tsx"
99118
}
100119
}

0 commit comments

Comments
 (0)