-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
package: utilsIssues related to the @typescript-eslint/utils packageIssues related to the @typescript-eslint/utils packagetriageWaiting for team members to take a lookWaiting for team members to take a look
Description
-
I have tried restarting my IDE and the issue persists.N/A - I have updated to the latest version of the packages.
- I have read the FAQ and my problem is not listed.
Repro
Going off the code snippet here: #4124 (comment)
This gives an error [playground link]:
import { TSESLint } from '@typescript-eslint/experimental-utils';
// Generic type 'RuleModule<TMessageIds, TOptions, TRuleListener>' requires between 2 and 3 type arguments.
export const rule: TSESLint.RuleModule = {
Although I personally would use RuleCreator
, or failing that specify those TMessageIds
and TOptions
type arguments, it is inconvenient for folks getting started with writing rules to have to specify them. It would make for smoother documentation if we didn't have to walk people through setting them up until they're needed.
Proposal:
interface RuleModule<
- TMessageIds extends string,
+ TMessageIds extends string = string,
- TOptions extends readonly unknown[],
+ TOptions extends readonly unknown[] = [],
Versions
package | version |
---|---|
@typescript-eslint/experimental-utils |
5.3.1 |
TypeScript |
N/A |
node |
N/A |
Metadata
Metadata
Assignees
Labels
package: utilsIssues related to the @typescript-eslint/utils packageIssues related to the @typescript-eslint/utils packagetriageWaiting for team members to take a lookWaiting for team members to take a look