@huangjunsen/commitlint-config 1.0.0 → 1.0.2

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 (3) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/index.js +69 -17
  3. package/package.json +11 -2
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @huangjunsen/commitlint-config
2
+
3
+ ## 1.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - feat: 适配 eslint flat config,接入 cz-git,新增 prettier-config 与第三方预设支持
package/index.js CHANGED
@@ -1,17 +1,69 @@
1
- module.exports = {
2
- parserPreset: 'conventional-changelog-conventionalcommits', // 使用 conventional-changelog-conventionalcommits 解析器预设
3
- rules: {
4
- 'body-leading-blank': [1, 'always'], // 正文之前必须始终有空行
5
- 'body-max-line-length': [2, 'always', 100], // 正文每行长度必须始终不超过 100 个字符
6
- 'footer-leading-blank': [1, 'always'], // 页脚之前必须始终有空行
7
- 'footer-max-line-length': [2, 'always', 100], // 页脚每行长度必须始终不超过 100 个字符
8
- 'header-max-length': [2, 'always', 100], // 标题长度必须始终不超过 100 个字符
9
- 'scope-case': [2, 'always', 'lower-case'], // 作用域必须始终为小写
10
- 'subject-case': [0], // 主题不做大小写校验
11
- 'subject-empty': [2, 'never'], // 主题不能为空
12
- 'subject-full-stop': [2, 'never', '.'], // 主题末尾不应包含句号
13
- 'type-case': [2, 'always', 'lower-case'], // 类型必须始终为小写
14
- 'type-empty': [2, 'never'], // 类型不能为空
15
- 'type-enum': [2, 'always', ['feat', 'fix', 'docs', 'style', 'test', 'refactor', 'chore', 'revert']], // 类型必须是预定义的枚举值之一
16
- },
17
- };
1
+ module.exports = {
2
+ parserPreset: 'conventional-changelog-conventionalcommits', // 使用 conventional-changelog-conventionalcommits 解析器预设
3
+ rules: {
4
+ 'body-leading-blank': [1, 'always'], // 正文之前必须始终有空行
5
+ 'body-max-line-length': [2, 'always', 100], // 正文每行长度必须始终不超过 100 个字符
6
+ 'footer-leading-blank': [1, 'always'], // 页脚之前必须始终有空行
7
+ 'footer-max-line-length': [2, 'always', 100], // 页脚每行长度必须始终不超过 100 个字符
8
+ 'header-max-length': [2, 'always', 100], // 标题长度必须始终不超过 100 个字符
9
+ 'scope-case': [2, 'always', 'lower-case'], // 作用域必须始终为小写
10
+ 'subject-case': [0], // 主题不做大小写校验
11
+ 'subject-empty': [2, 'never'], // 主题不能为空
12
+ 'subject-full-stop': [2, 'never', '.'], // 主题末尾不应包含句号
13
+ 'type-case': [2, 'always', 'lower-case'], // 类型必须始终为小写
14
+ 'type-empty': [2, 'never'], // 类型不能为空
15
+ 'type-enum': [2, 'always', ['feat', 'fix', 'docs', 'style', 'test', 'refactor', 'chore', 'revert', 'perf', 'build', 'ci']], // 类型必须是预定义的枚举值之一
16
+ },
17
+ prompt: {
18
+ messages: {
19
+ type: '选择你要提交的类型 :',
20
+ scope: '选择一个提交范围 (可选):',
21
+ customScope: '请输入自定义的提交范围 :',
22
+ subject: '填写简短精炼的变更描述 :\n',
23
+ body: '填写更加详细的变更描述 (可选)。使用 "|" 换行 :\n',
24
+ breaking: '列举非兼容性重大的变更 (可选)。使用 "|" 换行 :\n',
25
+ footerPrefixesSelect: '选择关联issue前缀 (可选):',
26
+ customFooterPrefix: '输入自定义issue前缀 :',
27
+ footer: '列举关联issue (可选) 例如: #31, #I3244 :\n',
28
+ confirmCommit: '是否提交或修改commit ?',
29
+ },
30
+ types: [
31
+ { value: 'feat', name: 'feat: ✨ 新增功能 | A new feature' },
32
+ { value: 'fix', name: 'fix: 🐛 修复缺陷 | A bug fix' },
33
+ { value: 'docs', name: 'docs: 📝 文档更新 | Documentation only changes' },
34
+ { value: 'style', name: 'style: 💄 代码格式 | Changes that do not affect the meaning of the code' },
35
+ { value: 'refactor', name: 'refactor: ♻️ 代码重构 | A code change that neither fixes a bug nor adds a feature' },
36
+ { value: 'perf', name: 'perf: ⚡️ 性能提升 | A code change that improves performance' },
37
+ { value: 'test', name: 'test: ✅ 测试相关 | Adding missing tests or correcting existing tests' },
38
+ { value: 'build', name: 'build: 📦️ 构建流程 | Changes that affect the build system or external dependencies' },
39
+ { value: 'ci', name: 'ci: 🎡 持续集成 | Changes to our CI configuration files and scripts' },
40
+ { value: 'revert', name: 'revert: ⏪️ 回退代码 | Revert to a commit' },
41
+ { value: 'chore', name: 'chore: 🔨 其他修改 | Other changes that don\'t modify src or test files' },
42
+ ],
43
+ useEmoji: true,
44
+ emojiAlign: 'center',
45
+ themeColorCode: '',
46
+ scopes: [],
47
+ allowCustomScopes: true,
48
+ allowEmptyScopes: true,
49
+ customScopesAlign: 'bottom',
50
+ customScopesAlias: 'custom',
51
+ emptyScopesAlias: 'empty',
52
+ upperCaseSubject: false,
53
+ markBreakingChangeNodes: ['!'],
54
+ breaklineNumber: 100,
55
+ breaklineChar: '|',
56
+ skipQuestions: [],
57
+ issuePrefixes: [{ value: 'closed', name: 'closed: ISSUES has been resolved' }],
58
+ customIssuePrefixAlign: 'top',
59
+ emptyIssuePrefixAlias: 'skip',
60
+ confirmColorActive: 'green',
61
+ confirmColorReset: 'reset',
62
+ defaultHeader: '',
63
+ defaultBody: '',
64
+ defaultFooter: '',
65
+ defaultIssues: '',
66
+ defaultScope: '',
67
+ defaultSubject: '',
68
+ },
69
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huangjunsen/commitlint-config",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Git规范",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -12,7 +12,16 @@
12
12
  "homepage": "https://github.com/Huang-junsen/js-encode-fe-spec#readme",
13
13
  "license": "ISC",
14
14
  "dependencies": {
15
- "conventional-changelog-conventionalcommits": "^7.0.2"
15
+ "conventional-changelog-conventionalcommits": "^7.0.2",
16
+ "cz-git": "^1.9.1"
17
+ },
18
+ "peerDependencies": {
19
+ "@commitlint/cli": ">=16.0.0"
20
+ },
21
+ "peerDependenciesMeta": {
22
+ "@commitlint/cli": {
23
+ "optional": true
24
+ }
16
25
  },
17
26
  "repository": {
18
27
  "type": "git",