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

Configs: Make sure that the stylistic config doesn't conflict with isolatedDeclarations #10001

Closed as not planned
Labels
locked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginpreset config changeProposal for an addition, removal, or general change to a preset configwontfixThis will not be worked on
@blickly

Description

@blickly

Before You File a Proposal Please Confirm You Have Done The Following...

Description

The stylistic config includes thehttps://typescript-eslint.io/rules/consistent-generic-constructors/ rule, which (in it's default configuration) conflicts with the requirements of TS 5.5's newisolatedDeclarations mode.

In isolatedDeclarations mode, the following code is illegal:

export const s = new Set<string>();

giving an error: "Variable must have an explicit type annotation with --isolatedDeclarations."
TypeScript Playground

Whereas in ESLint, the opposite pattern is disallowed by theconsistent-generic-constructors from the stylistic config:

export const s: Set<string> = new Set();

gives a different error: "The generic type arguments should be specified as part of the constructor type arguments."
ESLint Playground

Ideally, users using both the stylistic config and the isolatedDeclartions tsconfig option should have a less frustrating out-of-the-box experience. I think ESLint devs are better positioned to make the call on what that should look like, but I few options that I can think of would be:

  1. Turn offconsistent-generic-constructors by default in the stylistic config, or
  2. Change the default behavior ofconsistent-generic-constructors to avoid running on isolatedDeclarations projects, or
  3. Change the default behavior to distinguish local and exported declarations so it can give errors that don't contradict the isolatedDeclarations ones.

Impacted Configurations

stylistic

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    locked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginpreset config changeProposal for an addition, removal, or general change to a preset configwontfixThis will not be worked on

    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