@commitlint/types 9.1.0 → 11.0.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.
- package/CHANGELOG.md +46 -0
- package/lib/format.d.ts +28 -0
- package/lib/format.d.ts.map +1 -0
- package/lib/format.js +3 -0
- package/lib/format.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +17 -9
- package/lib/index.js.map +1 -1
- package/lib/lint.d.ts +4 -3
- package/lib/lint.d.ts.map +1 -1
- package/lib/load.d.ts +5 -55
- package/lib/load.d.ts.map +1 -1
- package/lib/load.js +0 -11
- package/lib/load.js.map +1 -1
- package/lib/rules.d.ts +66 -7
- package/lib/rules.d.ts.map +1 -1
- package/lib/rules.js +19 -0
- package/lib/rules.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,52 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [11.0.0](https://github.com/conventional-changelog/commitlint/compare/v10.0.0...v11.0.0) (2020-09-05)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @commitlint/types
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [10.0.0](https://github.com/conventional-changelog/commitlint/compare/v9.1.2...v10.0.0) (2020-08-16)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
* refactor!: drop support for node 8 (#1999) ([751f39f](https://github.com/conventional-changelog/commitlint/commit/751f39f284ef232574a176c3c11b1982ee544166)), closes [#1999](https://github.com/conventional-changelog/commitlint/issues/1999)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### BREAKING CHANGES
|
|
21
|
+
|
|
22
|
+
* remove node 8 from circle-ci checks
|
|
23
|
+
|
|
24
|
+
also remove node 13 because we do not support experimental versions
|
|
25
|
+
|
|
26
|
+
* docs: update node v10 to latest LTS 10 version
|
|
27
|
+
|
|
28
|
+
Co-authored-by: Cedric van Putten <me@bycedric.com>
|
|
29
|
+
|
|
30
|
+
Co-authored-by: Cedric van Putten <me@bycedric.com>
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## [9.1.2](https://github.com/conventional-changelog/commitlint/compare/v9.1.1...v9.1.2) (2020-07-13)
|
|
37
|
+
|
|
38
|
+
**Note:** Version bump only for package @commitlint/types
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
## [9.1.1](https://github.com/conventional-changelog/commitlint/compare/v9.1.0...v9.1.1) (2020-06-30)
|
|
45
|
+
|
|
46
|
+
**Note:** Version bump only for package @commitlint/types
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
6
52
|
# [9.1.0](https://github.com/conventional-changelog/commitlint/compare/v9.0.1...v9.1.0) (2020-06-21)
|
|
7
53
|
|
|
8
54
|
|
package/lib/format.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { QualifiedRules } from './load';
|
|
3
|
+
import { RuleConfigSeverity } from './rules';
|
|
4
|
+
export declare type Formatter = (report: FormattableReport, options: FormatOptions) => string;
|
|
5
|
+
export interface FormattableProblem {
|
|
6
|
+
level: RuleConfigSeverity;
|
|
7
|
+
name: keyof QualifiedRules;
|
|
8
|
+
message: string;
|
|
9
|
+
}
|
|
10
|
+
export interface FormattableResult {
|
|
11
|
+
errors?: FormattableProblem[];
|
|
12
|
+
warnings?: FormattableProblem[];
|
|
13
|
+
}
|
|
14
|
+
export interface WithInput {
|
|
15
|
+
input?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface FormattableReport {
|
|
18
|
+
results?: (FormattableResult & WithInput)[];
|
|
19
|
+
}
|
|
20
|
+
export declare type ChalkColor = keyof typeof chalk;
|
|
21
|
+
export interface FormatOptions {
|
|
22
|
+
color?: boolean;
|
|
23
|
+
signs?: readonly [string, string, string];
|
|
24
|
+
colors?: readonly [ChalkColor, ChalkColor, ChalkColor];
|
|
25
|
+
verbose?: boolean;
|
|
26
|
+
helpUrl?: string;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,cAAc,EAAC,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAC;AAE3C,oBAAY,SAAS,GAAG,CACvB,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,aAAa,KAClB,MAAM,CAAC;AAEZ,MAAM,WAAW,kBAAkB;IAClC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,IAAI,EAAE,MAAM,cAAc,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IACjC,MAAM,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,SAAS;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IACjC,OAAO,CAAC,EAAE,CAAC,iBAAiB,GAAG,SAAS,CAAC,EAAE,CAAC;CAC5C;AAED,oBAAY,UAAU,GAAG,MAAM,OAAO,KAAK,CAAC;AAE5C,MAAM,WAAW,aAAa;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,MAAM,CAAC,EAAE,SAAS,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IACvD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
package/lib/format.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":""}
|
package/lib/index.d.ts
CHANGED
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
5
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
__exportStar(require("./ensure"), exports);
|
|
14
|
+
__exportStar(require("./format"), exports);
|
|
15
|
+
__exportStar(require("./is-ignored"), exports);
|
|
16
|
+
__exportStar(require("./rules"), exports);
|
|
17
|
+
__exportStar(require("./lint"), exports);
|
|
18
|
+
__exportStar(require("./load"), exports);
|
|
19
|
+
__exportStar(require("./parse"), exports);
|
|
12
20
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyB;AACzB,2CAAyB;AACzB,+CAA6B;AAC7B,0CAAwB;AACxB,yCAAuB;AACvB,yCAAuB;AACvB,0CAAwB"}
|
package/lib/lint.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { IsIgnoredOptions } from './is-ignored';
|
|
2
|
-
import {
|
|
2
|
+
import { PluginRecords } from './load';
|
|
3
3
|
import { ParserOptions } from './parse';
|
|
4
|
-
|
|
4
|
+
import { RuleConfigSeverity, RuleConfigTuple } from './rules';
|
|
5
|
+
export declare type LintRuleConfig = Record<string, Readonly<[RuleConfigSeverity.Disabled]> | RuleConfigTuple<void> | RuleConfigTuple<unknown>>;
|
|
5
6
|
export interface LintOptions {
|
|
6
7
|
/** If it should ignore the default commit messages (defaults to `true`) */
|
|
7
8
|
defaultIgnores?: IsIgnoredOptions['defaults'];
|
|
@@ -25,7 +26,7 @@ export interface LintRuleOutcome {
|
|
|
25
26
|
/** If the commit is considered valid for the rule */
|
|
26
27
|
valid: boolean;
|
|
27
28
|
/** The "severity" of the rule (1 = warning, 2 = error) */
|
|
28
|
-
level:
|
|
29
|
+
level: RuleConfigSeverity;
|
|
29
30
|
/** The name of the rule */
|
|
30
31
|
name: string;
|
|
31
32
|
/** The message returned from the rule, if invalid */
|
package/lib/lint.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../src/lint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../src/lint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,aAAa,EAAC,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAC,aAAa,EAAC,MAAM,SAAS,CAAC;AACtC,OAAO,EAAC,kBAAkB,EAAE,eAAe,EAAC,MAAM,SAAS,CAAC;AAE5D,oBAAY,cAAc,GAAG,MAAM,CAClC,MAAM,EACJ,QAAQ,CAAC,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,GACvC,eAAe,CAAC,IAAI,CAAC,GACrB,eAAe,CAAC,OAAO,CAAC,CAC1B,CAAC;AAEF,MAAM,WAAW,WAAW;IAC3B,2EAA2E;IAC3E,cAAc,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAC9C,gEAAgE;IAChE,OAAO,CAAC,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;IACtC,8DAA8D;IAC9D,UAAU,CAAC,EAAE,aAAa,CAAC;IAE3B,OAAO,CAAC,EAAE,aAAa,CAAC;CACxB;AAED,MAAM,WAAW,WAAW;IAC3B,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,KAAK,EAAE,OAAO,CAAC;IACf,2CAA2C;IAC3C,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,6CAA6C;IAC7C,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC/B,qDAAqD;IACrD,KAAK,EAAE,OAAO,CAAC;IACf,0DAA0D;IAC1D,KAAK,EAAE,kBAAkB,CAAC;IAC1B,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAC;CAChB"}
|
package/lib/load.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Rule, RuleCondition } from './rules';
|
|
1
|
+
import { Rule, RulesConfig, RuleConfigQuality } from './rules';
|
|
3
2
|
export declare type PluginRecords = Record<string, Plugin>;
|
|
4
3
|
export interface Plugin {
|
|
5
4
|
rules: {
|
|
@@ -10,58 +9,9 @@ export interface LoadOptions {
|
|
|
10
9
|
cwd?: string;
|
|
11
10
|
file?: string;
|
|
12
11
|
}
|
|
13
|
-
export declare enum RuleSeverity {
|
|
14
|
-
Disabled = 0,
|
|
15
|
-
Warning = 1,
|
|
16
|
-
Error = 2
|
|
17
|
-
}
|
|
18
|
-
export declare type RuleConfigTuple<T> = T extends void ? Readonly<[RuleSeverity, RuleCondition]> : Readonly<[RuleSeverity, RuleCondition, T]>;
|
|
19
|
-
export declare enum RuleConfigQuality {
|
|
20
|
-
User = 0,
|
|
21
|
-
Qualified = 1
|
|
22
|
-
}
|
|
23
|
-
export declare type QualifiedRuleConfig<T> = (() => RuleConfigTuple<T>) | (() => RuleConfigTuple<Promise<T>>) | RuleConfigTuple<T>;
|
|
24
|
-
export declare type RuleConfig<V = RuleConfigQuality.Qualified, T = void> = V extends RuleConfigQuality.Qualified ? RuleConfigTuple<T> : QualifiedRuleConfig<T>;
|
|
25
|
-
export declare type CaseRuleConfig<V = RuleConfigQuality.User> = RuleConfig<V, TargetCaseType>;
|
|
26
|
-
export declare type LengthRuleConfig<V = RuleConfigQuality.User> = RuleConfig<V, number>;
|
|
27
|
-
export declare type EnumRuleConfig<V = RuleConfigQuality.User> = RuleConfig<V, string[]>;
|
|
28
|
-
export declare type RulesConfig<V = RuleConfigQuality.User> = {
|
|
29
|
-
'body-case': CaseRuleConfig<V>;
|
|
30
|
-
'body-empty': RuleConfig<V>;
|
|
31
|
-
'body-leading-blank': RuleConfig<V>;
|
|
32
|
-
'body-max-length': LengthRuleConfig<V>;
|
|
33
|
-
'body-max-line-length': LengthRuleConfig<V>;
|
|
34
|
-
'body-min-length': LengthRuleConfig<V>;
|
|
35
|
-
'footer-empty': RuleConfig<V>;
|
|
36
|
-
'footer-leading-blank': RuleConfig<V>;
|
|
37
|
-
'footer-max-length': LengthRuleConfig<V>;
|
|
38
|
-
'footer-max-line-length': LengthRuleConfig<V>;
|
|
39
|
-
'footer-min-length': LengthRuleConfig<V>;
|
|
40
|
-
'header-case': CaseRuleConfig<V>;
|
|
41
|
-
'header-full-stop': RuleConfig<V>;
|
|
42
|
-
'header-max-length': LengthRuleConfig<V>;
|
|
43
|
-
'header-min-length': LengthRuleConfig<V>;
|
|
44
|
-
'references-empty': RuleConfig<V>;
|
|
45
|
-
'scope-case': CaseRuleConfig<V>;
|
|
46
|
-
'scope-empty': RuleConfig<V>;
|
|
47
|
-
'scope-enum': EnumRuleConfig<V>;
|
|
48
|
-
'scope-max-length': LengthRuleConfig<V>;
|
|
49
|
-
'scope-min-length': LengthRuleConfig<V>;
|
|
50
|
-
'signed-off-by': RuleConfig<V>;
|
|
51
|
-
'subject-case': CaseRuleConfig<V>;
|
|
52
|
-
'subject-empty': RuleConfig<V>;
|
|
53
|
-
'subject-full-stop': RuleConfig<V>;
|
|
54
|
-
'subject-max-length': LengthRuleConfig<V>;
|
|
55
|
-
'subject-min-length': LengthRuleConfig<V>;
|
|
56
|
-
'type-case': CaseRuleConfig<V>;
|
|
57
|
-
'type-empty': RuleConfig<V>;
|
|
58
|
-
'type-enum': EnumRuleConfig<V>;
|
|
59
|
-
'type-max-length': LengthRuleConfig<V>;
|
|
60
|
-
'type-min-length': LengthRuleConfig<V>;
|
|
61
|
-
};
|
|
62
12
|
export interface UserConfig {
|
|
63
13
|
extends?: string[];
|
|
64
|
-
formatter?:
|
|
14
|
+
formatter?: string;
|
|
65
15
|
rules?: Partial<RulesConfig>;
|
|
66
16
|
parserPreset?: string | ParserPreset;
|
|
67
17
|
ignores?: ((commit: string) => boolean)[];
|
|
@@ -70,7 +20,7 @@ export interface UserConfig {
|
|
|
70
20
|
}
|
|
71
21
|
export interface UserPreset {
|
|
72
22
|
extends?: string[];
|
|
73
|
-
formatter?:
|
|
23
|
+
formatter?: string;
|
|
74
24
|
rules?: Partial<RulesConfig>;
|
|
75
25
|
parserPreset?: string | ParserPreset;
|
|
76
26
|
ignores?: ((commit: string) => boolean)[];
|
|
@@ -80,8 +30,8 @@ export interface UserPreset {
|
|
|
80
30
|
export declare type QualifiedRules = Partial<RulesConfig<RuleConfigQuality.Qualified>>;
|
|
81
31
|
export interface QualifiedConfig {
|
|
82
32
|
extends: string[];
|
|
83
|
-
formatter:
|
|
84
|
-
rules:
|
|
33
|
+
formatter: string;
|
|
34
|
+
rules: QualifiedRules;
|
|
85
35
|
parserPreset: ParserPreset;
|
|
86
36
|
ignores: ((commit: string) => boolean)[];
|
|
87
37
|
defaultIgnores: boolean;
|
package/lib/load.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../src/load.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../src/load.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAE,WAAW,EAAE,iBAAiB,EAAC,MAAM,SAAS,CAAC;AAE7D,oBAAY,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEnD,MAAM,WAAW,MAAM;IACtB,KAAK,EAAE;QACN,CAA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,OAAO,CAAC,EAAE,CAAC;IACzC,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,aAAa,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
package/lib/load.js
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var RuleSeverity;
|
|
4
|
-
(function (RuleSeverity) {
|
|
5
|
-
RuleSeverity[RuleSeverity["Disabled"] = 0] = "Disabled";
|
|
6
|
-
RuleSeverity[RuleSeverity["Warning"] = 1] = "Warning";
|
|
7
|
-
RuleSeverity[RuleSeverity["Error"] = 2] = "Error";
|
|
8
|
-
})(RuleSeverity = exports.RuleSeverity || (exports.RuleSeverity = {}));
|
|
9
|
-
var RuleConfigQuality;
|
|
10
|
-
(function (RuleConfigQuality) {
|
|
11
|
-
RuleConfigQuality[RuleConfigQuality["User"] = 0] = "User";
|
|
12
|
-
RuleConfigQuality[RuleConfigQuality["Qualified"] = 1] = "Qualified";
|
|
13
|
-
})(RuleConfigQuality = exports.RuleConfigQuality || (exports.RuleConfigQuality = {}));
|
|
14
3
|
//# sourceMappingURL=load.js.map
|
package/lib/load.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.js","sourceRoot":"","sources":["../src/load.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"load.js","sourceRoot":"","sources":["../src/load.ts"],"names":[],"mappings":""}
|
package/lib/rules.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
+
import { TargetCaseType } from './ensure';
|
|
1
2
|
import { Commit } from './parse';
|
|
2
|
-
/**
|
|
3
|
-
* Rules always have a condition.
|
|
4
|
-
* It can be either "always" (as tested), or "never" (as tested).
|
|
5
|
-
* For example, `header-full-stop` can be enforced as "always" or "never".
|
|
6
|
-
*/
|
|
7
|
-
export declare type RuleCondition = 'always' | 'never';
|
|
8
3
|
/**
|
|
9
4
|
* Rules match the input either as successful or failed.
|
|
10
5
|
* For example, when `header-full-stop` detects a full stop and is set as "always"; it's true.
|
|
@@ -16,8 +11,72 @@ export declare type RuleOutcome = Readonly<[boolean, string?]>;
|
|
|
16
11
|
* All rules should provide the most sensible rule condition and value.
|
|
17
12
|
*/
|
|
18
13
|
export declare type RuleType = 'async' | 'sync' | 'either';
|
|
19
|
-
export declare type BaseRule<Value = never, Type extends RuleType = 'either'> = (parsed: Commit, when?:
|
|
14
|
+
export declare type BaseRule<Value = never, Type extends RuleType = 'either'> = (parsed: Commit, when?: RuleConfigCondition, value?: Value) => Type extends 'either' ? RuleOutcome | Promise<RuleOutcome> : Type extends 'async' ? Promise<RuleOutcome> : Type extends 'sync' ? RuleOutcome : never;
|
|
20
15
|
export declare type Rule<Value = never> = BaseRule<Value, 'either'>;
|
|
21
16
|
export declare type AsyncRule<Value = never> = BaseRule<Value, 'async'>;
|
|
22
17
|
export declare type SyncRule<Value = never> = BaseRule<Value, 'sync'>;
|
|
18
|
+
/**
|
|
19
|
+
* Rules always have a severity.
|
|
20
|
+
* Severity indicates what to do if the rule is found to be broken
|
|
21
|
+
* 0 - Disable this rule
|
|
22
|
+
* 1 - Warn for violations
|
|
23
|
+
* 2 - Error for violations
|
|
24
|
+
*/
|
|
25
|
+
export declare enum RuleConfigSeverity {
|
|
26
|
+
Disabled = 0,
|
|
27
|
+
Warning = 1,
|
|
28
|
+
Error = 2
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Rules always have a condition.
|
|
32
|
+
* It can be either "always" (as tested), or "never" (as tested).
|
|
33
|
+
* For example, `header-full-stop` can be enforced as "always" or "never".
|
|
34
|
+
*/
|
|
35
|
+
export declare type RuleConfigCondition = 'always' | 'never';
|
|
36
|
+
export declare type RuleConfigTuple<T> = T extends void ? Readonly<[RuleConfigSeverity.Disabled]> | Readonly<[RuleConfigSeverity, RuleConfigCondition]> : Readonly<[RuleConfigSeverity.Disabled]> | Readonly<[RuleConfigSeverity, RuleConfigCondition, T]>;
|
|
37
|
+
export declare enum RuleConfigQuality {
|
|
38
|
+
User = 0,
|
|
39
|
+
Qualified = 1
|
|
40
|
+
}
|
|
41
|
+
export declare type QualifiedRuleConfig<T> = (() => RuleConfigTuple<T>) | (() => RuleConfigTuple<Promise<T>>) | RuleConfigTuple<T>;
|
|
42
|
+
export declare type RuleConfig<V = RuleConfigQuality.Qualified, T = void> = V extends RuleConfigQuality.Qualified ? RuleConfigTuple<T> : QualifiedRuleConfig<T>;
|
|
43
|
+
export declare type CaseRuleConfig<V = RuleConfigQuality.User> = RuleConfig<V, TargetCaseType>;
|
|
44
|
+
export declare type LengthRuleConfig<V = RuleConfigQuality.User> = RuleConfig<V, number>;
|
|
45
|
+
export declare type EnumRuleConfig<V = RuleConfigQuality.User> = RuleConfig<V, string[]>;
|
|
46
|
+
export declare type RulesConfig<V = RuleConfigQuality.User> = {
|
|
47
|
+
'body-case': CaseRuleConfig<V>;
|
|
48
|
+
'body-empty': RuleConfig<V>;
|
|
49
|
+
'body-leading-blank': RuleConfig<V>;
|
|
50
|
+
'body-max-length': LengthRuleConfig<V>;
|
|
51
|
+
'body-max-line-length': LengthRuleConfig<V>;
|
|
52
|
+
'body-min-length': LengthRuleConfig<V>;
|
|
53
|
+
'footer-empty': RuleConfig<V>;
|
|
54
|
+
'footer-leading-blank': RuleConfig<V>;
|
|
55
|
+
'footer-max-length': LengthRuleConfig<V>;
|
|
56
|
+
'footer-max-line-length': LengthRuleConfig<V>;
|
|
57
|
+
'footer-min-length': LengthRuleConfig<V>;
|
|
58
|
+
'header-case': CaseRuleConfig<V>;
|
|
59
|
+
'header-full-stop': RuleConfig<V>;
|
|
60
|
+
'header-max-length': LengthRuleConfig<V>;
|
|
61
|
+
'header-min-length': LengthRuleConfig<V>;
|
|
62
|
+
'references-empty': RuleConfig<V>;
|
|
63
|
+
'scope-case': CaseRuleConfig<V>;
|
|
64
|
+
'scope-empty': RuleConfig<V>;
|
|
65
|
+
'scope-enum': EnumRuleConfig<V>;
|
|
66
|
+
'scope-max-length': LengthRuleConfig<V>;
|
|
67
|
+
'scope-min-length': LengthRuleConfig<V>;
|
|
68
|
+
'signed-off-by': RuleConfig<V>;
|
|
69
|
+
'subject-case': CaseRuleConfig<V>;
|
|
70
|
+
'subject-empty': RuleConfig<V>;
|
|
71
|
+
'subject-full-stop': RuleConfig<V>;
|
|
72
|
+
'subject-max-length': LengthRuleConfig<V>;
|
|
73
|
+
'subject-min-length': LengthRuleConfig<V>;
|
|
74
|
+
'type-case': CaseRuleConfig<V>;
|
|
75
|
+
'type-empty': RuleConfig<V>;
|
|
76
|
+
'type-enum': EnumRuleConfig<V>;
|
|
77
|
+
'type-max-length': LengthRuleConfig<V>;
|
|
78
|
+
'type-min-length': LengthRuleConfig<V>;
|
|
79
|
+
[key: string]: AnyRuleConfig<V>;
|
|
80
|
+
};
|
|
81
|
+
export declare type AnyRuleConfig<V> = RuleConfig<V, unknown> | RuleConfig<V, void>;
|
|
23
82
|
//# sourceMappingURL=rules.d.ts.map
|
package/lib/rules.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../src/rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../src/rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,UAAU,CAAC;AACxC,OAAO,EAAC,MAAM,EAAC,MAAM,SAAS,CAAC;AAE/B;;;;GAIG;AACH,oBAAY,WAAW,GAAG,QAAQ,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;AAEvD;;;GAGG;AACH,oBAAY,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,C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AAC,CAAC,EAAE,OAAO,CAAC,GAAG,UAAU,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC"}
|
package/lib/rules.js
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RuleConfigQuality = exports.RuleConfigSeverity = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Rules always have a severity.
|
|
6
|
+
* Severity indicates what to do if the rule is found to be broken
|
|
7
|
+
* 0 - Disable this rule
|
|
8
|
+
* 1 - Warn for violations
|
|
9
|
+
* 2 - Error for violations
|
|
10
|
+
*/
|
|
11
|
+
var RuleConfigSeverity;
|
|
12
|
+
(function (RuleConfigSeverity) {
|
|
13
|
+
RuleConfigSeverity[RuleConfigSeverity["Disabled"] = 0] = "Disabled";
|
|
14
|
+
RuleConfigSeverity[RuleConfigSeverity["Warning"] = 1] = "Warning";
|
|
15
|
+
RuleConfigSeverity[RuleConfigSeverity["Error"] = 2] = "Error";
|
|
16
|
+
})(RuleConfigSeverity = exports.RuleConfigSeverity || (exports.RuleConfigSeverity = {}));
|
|
17
|
+
var RuleConfigQuality;
|
|
18
|
+
(function (RuleConfigQuality) {
|
|
19
|
+
RuleConfigQuality[RuleConfigQuality["User"] = 0] = "User";
|
|
20
|
+
RuleConfigQuality[RuleConfigQuality["Qualified"] = 1] = "Qualified";
|
|
21
|
+
})(RuleConfigQuality = exports.RuleConfigQuality || (exports.RuleConfigQuality = {}));
|
|
3
22
|
//# sourceMappingURL=rules.js.map
|
package/lib/rules.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../src/rules.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../src/rules.ts"],"names":[],"mappings":";;;AAgCA;;;;;;GAMG;AACH,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC7B,mEAAY,CAAA;IACZ,iEAAW,CAAA;IACX,6DAAS,CAAA;AACV,CAAC,EAJW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAI7B;AAiBD,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC5B,yDAAI,CAAA;IACJ,mEAAS,CAAA;AACV,CAAC,EAHW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAG5B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commitlint/types",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0",
|
|
4
4
|
"description": "Shared types for commitlint packages",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"pkg": "pkg-check"
|
|
12
12
|
},
|
|
13
13
|
"engines": {
|
|
14
|
-
"node": ">=
|
|
14
|
+
"node": ">=v10.22.0"
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@commitlint/utils": "^
|
|
30
|
+
"@commitlint/utils": "^11.0.0"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "922317463f7c90c0fb319e075de533dd63343863"
|
|
33
33
|
}
|