Skip to content

Commit 0832171

Browse files
committed
reuse the type of args
1 parent dd2a7ff commit 0832171

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

types/stylelint/index.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ type FileCache = {
4242
// method declarations tricks TypeScript into bivariant signature checking. More details can
4343
// be found here: https://stackoverflow.com/questions/52667959/what-is-the-purpose-of-bivariancehack-in-typescript-types.
4444
// and in the original discussion: https://github.com/stylelint/stylelint/pull/6147#issuecomment-1155337016.
45+
type RuleFuncArgs = (string | number | boolean | RegExp | string[])[];
46+
4547
type RuleMessageFunc = {
46-
bivariance(...args: (string | number | boolean | RegExp | string[])[]): string;
48+
bivariance(...args: RuleFuncArgs): string;
4749
}['bivariance'];
4850

4951
type RuleSeverityFunc = {
50-
bivariance(...args: (string | number | boolean | RegExp | string[])[]): stylelint.Severity | null;
52+
bivariance(...args: RuleFuncArgs): stylelint.Severity | null;
5153
}['bivariance'];
5254

5355
type RuleOptionsPossibleFunc = (value: unknown) => boolean;

0 commit comments

Comments
 (0)