Skip to content

Commit efc79e1

Browse files
committed
Adding in type definitions for rule resolvers.
1 parent 4592269 commit efc79e1

File tree

1 file changed

+18
-18
lines changed
  • packages/commitlint-plugin-github-rules/@types

1 file changed

+18
-18
lines changed

packages/commitlint-plugin-github-rules/@types/index.d.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1+
import { When } from 'commitlint-github-utils/@types';
2+
13
export type RuleResolverResult = [boolean, string?];
24

3-
export type RuleResolver<T> = (
4-
parsed: Partial<{
5-
type: string;
6-
scope: string;
7-
subject: string;
8-
merge: string;
9-
header: string;
10-
body: string;
11-
footer: string;
12-
notes: string[];
13-
references: string[];
14-
mentions: string[];
15-
revert: string;
16-
raw: string;
17-
}>,
18-
when?: string,
19-
value?: T,
20-
) => RuleResolverResult;
5+
export type BaseParsedCommit = Partial<{
6+
type: string;
7+
scope: string;
8+
subject: string;
9+
merge: string;
10+
header: string;
11+
body: string;
12+
footer: string;
13+
notes: string[];
14+
references: string[];
15+
mentions: string[];
16+
revert: string;
17+
raw: string;
18+
}>;
19+
20+
export type RuleResolver<T> = (parsed: BaseParsedCommit, when?: When, value?: T) => RuleResolverResult;
2121

2222
export interface CommitlintPluginGitHub {
2323
rules: {

0 commit comments

Comments
 (0)