Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Allow generic defaults for TSESLint.RuleModule? #4134

Closed
Labels
package: utilsIssues related to the @typescript-eslint/utils packagetriageWaiting for team members to take a look
@JoshuaKGoldberg

Description

@JoshuaKGoldberg
  • 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

packageversion
@typescript-eslint/experimental-utils5.3.1
TypeScriptN/A
nodeN/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: utilsIssues related to the @typescript-eslint/utils packagetriageWaiting for team members to take a look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp