@icebreakers/commitlint-config 4.0.2 → 4.0.4
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.
- package/dist/index.cjs +17 -11
- package/dist/index.d.cts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +16 -10
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -19,7 +19,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
19
|
}
|
|
20
20
|
return to;
|
|
21
21
|
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
23
23
|
value: mod,
|
|
24
24
|
enumerable: true
|
|
25
25
|
}) : target, mod));
|
|
@@ -110,8 +110,10 @@ function buildScopeRules(options) {
|
|
|
110
110
|
"always",
|
|
111
111
|
scopeValues
|
|
112
112
|
];
|
|
113
|
-
if (options.required !== void 0)
|
|
114
|
-
|
|
113
|
+
if (options.required !== void 0) {
|
|
114
|
+
if (options.required) rules["scope-empty"] = [severity, "never"];
|
|
115
|
+
else rules["scope-empty"] = [_commitlint_types.RuleConfigSeverity.Disabled];
|
|
116
|
+
}
|
|
115
117
|
const scopeCases = mergeUnique(asArray(options.case));
|
|
116
118
|
if (scopeCases.length > 0) rules["scope-case"] = [
|
|
117
119
|
severity,
|
|
@@ -129,14 +131,18 @@ function buildSubjectRules(options) {
|
|
|
129
131
|
options.caseCondition ?? "never",
|
|
130
132
|
forbiddenCases
|
|
131
133
|
];
|
|
132
|
-
if (options.allowEmpty !== void 0)
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
options.
|
|
138
|
-
|
|
139
|
-
|
|
134
|
+
if (options.allowEmpty !== void 0) {
|
|
135
|
+
if (options.allowEmpty) rules["subject-empty"] = [_commitlint_types.RuleConfigSeverity.Disabled];
|
|
136
|
+
else rules["subject-empty"] = [options.allowEmptySeverity ?? _commitlint_types.RuleConfigSeverity.Error, "never"];
|
|
137
|
+
}
|
|
138
|
+
if (options.fullStop !== void 0) {
|
|
139
|
+
if (options.fullStop) rules["subject-full-stop"] = [
|
|
140
|
+
options.fullStopSeverity ?? _commitlint_types.RuleConfigSeverity.Error,
|
|
141
|
+
"always",
|
|
142
|
+
options.fullStopCharacter ?? "."
|
|
143
|
+
];
|
|
144
|
+
else rules["subject-full-stop"] = [_commitlint_types.RuleConfigSeverity.Disabled];
|
|
145
|
+
}
|
|
140
146
|
return rules;
|
|
141
147
|
}
|
|
142
148
|
function buildHeaderRules(options) {
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -83,8 +83,10 @@ function buildScopeRules(options) {
|
|
|
83
83
|
"always",
|
|
84
84
|
scopeValues
|
|
85
85
|
];
|
|
86
|
-
if (options.required !== void 0)
|
|
87
|
-
|
|
86
|
+
if (options.required !== void 0) {
|
|
87
|
+
if (options.required) rules["scope-empty"] = [severity, "never"];
|
|
88
|
+
else rules["scope-empty"] = [RuleConfigSeverity.Disabled];
|
|
89
|
+
}
|
|
88
90
|
const scopeCases = mergeUnique(asArray(options.case));
|
|
89
91
|
if (scopeCases.length > 0) rules["scope-case"] = [
|
|
90
92
|
severity,
|
|
@@ -102,14 +104,18 @@ function buildSubjectRules(options) {
|
|
|
102
104
|
options.caseCondition ?? "never",
|
|
103
105
|
forbiddenCases
|
|
104
106
|
];
|
|
105
|
-
if (options.allowEmpty !== void 0)
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
options.
|
|
111
|
-
|
|
112
|
-
|
|
107
|
+
if (options.allowEmpty !== void 0) {
|
|
108
|
+
if (options.allowEmpty) rules["subject-empty"] = [RuleConfigSeverity.Disabled];
|
|
109
|
+
else rules["subject-empty"] = [options.allowEmptySeverity ?? RuleConfigSeverity.Error, "never"];
|
|
110
|
+
}
|
|
111
|
+
if (options.fullStop !== void 0) {
|
|
112
|
+
if (options.fullStop) rules["subject-full-stop"] = [
|
|
113
|
+
options.fullStopSeverity ?? RuleConfigSeverity.Error,
|
|
114
|
+
"always",
|
|
115
|
+
options.fullStopCharacter ?? "."
|
|
116
|
+
];
|
|
117
|
+
else rules["subject-full-stop"] = [RuleConfigSeverity.Disabled];
|
|
118
|
+
}
|
|
113
119
|
return rules;
|
|
114
120
|
}
|
|
115
121
|
function buildHeaderRules(options) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/commitlint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.4",
|
|
5
5
|
"description": "Commitlint preset from Icebreaker's dev-configs",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@commitlint/config-conventional": "^21.2.0",
|
|
54
54
|
"@commitlint/types": "^21.2.0",
|
|
55
|
-
"conventional-changelog-conventionalcommits": "^10.
|
|
55
|
+
"conventional-changelog-conventionalcommits": "^10.3.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@commitlint/lint": "^21.2.0",
|