What steps are needed to reproduce the bug?
Write a custom rule importing stylelint
Run the typechecker on that file (which will import the stylelint types).
This will report an error in the stylelint type
What Stylelint configuration is needed to reproduce the bug?
n/a
How did you run Stylelint?
n/a
Which version of Stylelint are you using?
14.12.0
What did you expect to happen?
No type checking error
What actually happened?
node_modules/stylelint/types/stylelint/index.d.ts:356:29 - error TS2344: Type 'RuleMessage' does not satisfy the constraint '(...args: any) => any'.
Type 'string' is not assignable to type '(...args: any) => any'.
356 messageArgs?: Parameters<RuleMessage> | undefined;
~~~~~~~~~~~
Found 1 error in node_modules/stylelint/types/stylelint/index.d.ts:356
Does the bug relate to non-standard syntax?
No response
Proposal to fix the bug
Use Parameters<RuleMessageFunc> instead of Parameters<RuleMessage> (RuleMessage is string | RuleMessageFunc) and fix the type linting to actually report such errors.
What steps are needed to reproduce the bug?
Write a custom rule importing stylelint
Run the typechecker on that file (which will import the stylelint types).
This will report an error in the stylelint type
What Stylelint configuration is needed to reproduce the bug?
n/a
How did you run Stylelint?
n/a
Which version of Stylelint are you using?
14.12.0
What did you expect to happen?
No type checking error
What actually happened?
Does the bug relate to non-standard syntax?
No response
Proposal to fix the bug
Use
Parameters<RuleMessageFunc>instead ofParameters<RuleMessage>(RuleMessageisstring | RuleMessageFunc) and fix the type linting to actually report such errors.