Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Description
I have tried restarting my IDE and the issue persists.N/A- I have updated to the latest version of the packages.
- I haveread 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.exportconstrule:TSESLint.RuleModule={
Although I personally would useRuleCreator
, or failing that specify thoseTMessageIds
andTOptions
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 |