commitlint-config-hcl 0.0.3-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +42 -0
  3. package/index.js +19 -0
  4. package/package.json +31 -0
package/LICENSE ADDED
@@ -0,0 +1 @@
1
+ MIT
package/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # `commitlint-config-hcl`
2
+
3
+ > 基础通用的Git Commitlint规范
4
+
5
+ 支持配套的 [commitlint 配置](https://commitlint.js.org/#/concepts-shareable-config),用于对 `git commit message` 进行校验。
6
+
7
+ ## 安装
8
+
9
+ 使用时,需要安装 [@commitlint/cli](https://www.npmjs.com/package/@commitlint/cli)
10
+
11
+ ```bash
12
+ npm install commitlint-config-hcl @commitlint/cli --save-dev
13
+ ```
14
+
15
+ ## 使用
16
+
17
+ 在 `commitlint.config.js` 中继承本包:
18
+
19
+ ```javascript
20
+ module.exports = {
21
+ extends: ['commitlint-config-hcl'],
22
+ };
23
+ ```
24
+
25
+ ## 设置 git hook
26
+
27
+ 可通过 [husky](https://www.npmjs.com/package/husky) 设置在 `git commit` 时触发 `commitlint`。
28
+
29
+ 首先安装 husky:
30
+
31
+ ```bash
32
+ npm install husky --save-dev
33
+ ```
34
+
35
+ 然后手动在`.husky`目录下添加`commit-msg`文件:
36
+
37
+ 内容:
38
+ ```bash
39
+ npx commitlint --edit $1
40
+ ```
41
+
42
+ 更多信息可参考 [commitlint 文档](https://commitlint.js.org/#/guides-local-setup?id=install-husky)。
package/index.js ADDED
@@ -0,0 +1,19 @@
1
+ module.exports = {
2
+ parserPreset: {
3
+ name: 'conventional-changelog-conventionalcommits',
4
+ },
5
+ rules: {
6
+ 'body-leading-blank': [1, 'always'],
7
+ 'body-max-line-length': [2, 'always', 100],
8
+ 'footer-leading-blank': [1, 'always'],
9
+ 'footer-max-line-length': [2, 'always', 100],
10
+ 'header-max-length': [2, 'always', 100],
11
+ 'scope-case': [2, 'always', 'lower-case'],
12
+ 'subject-case': [0],
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': [2, 'always', ['feat', 'fix', 'docs', 'style', 'test', 'refactor', 'chore', 'revert']],
18
+ },
19
+ };
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "commitlint-config-hcl",
3
+ "version": "0.0.3-alpha.0",
4
+ "description": "基于 commitlint 配置的基础通用的Git Commitlint规范",
5
+ "license": "ISC",
6
+ "author": "hechenglong <1104907547@qq.com>",
7
+ "main": "index.js",
8
+ "files": [
9
+ "index.js"
10
+ ],
11
+ "keywords": [
12
+ "commit",
13
+ "lint"
14
+ ],
15
+ "publishConfig": {
16
+ "registry": "https://registry.npmjs.org/",
17
+ "access": "public"
18
+ },
19
+ "homepage": "https://github.com/15272410401/front-end-coding-specification#readme",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/15272410401/front-end-coding-specification.git"
23
+ },
24
+ "bugs": {
25
+ "url": "https://github.com/15272410401/front-end-coding-specification/issues"
26
+ },
27
+ "dependencies": {
28
+ "conventional-changelog-conventionalcommits": "^10.2.0"
29
+ },
30
+ "gitHead": "2cf5f56362c04886dc8f937985cabd5794615f4d"
31
+ }