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

Enhancement: [ban-types] Split the {} ban into a separate, better-phrased rule #8700

Closed
Assignees
JoshuaKGoldberg
Labels
accepting prsGo ahead, send a pull request that resolves this issueenhancement: plugin rule optionNew rule option for an existing eslint-plugin rulelocked 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-plugin
Milestone
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

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

My proposal is suitable for this project

  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Link to the rule's documentation

https://typescript-eslint.io/rules/ban-types/

Description

Filing this issue as a followup/superset of the more targeted#8697. As ofmicrosoft/TypeScript#49119, TypeScript has much better handling of{} semantics than it did when theban-types default options were written.@RyanCavanaugh -the dev lead for TypeScript- called out inmicrosoft/TypeScript#57735 (comment) that as it stands today,{ } is a valid type with a valid meaning in TypeScript.

Proposal: let's re-think the default options inban-types to agree with the way TypeScript now works?

My first proposal would be, roughly...

  • Remove any bans of{} altogether, including inrecommended andstrict
  • Add a ban onNonNullable<unknown> that suggests switching to{}

...but I'd want to hear from@bradzacher and@RyanCavanaugh on whether that satisfies the intents of both TypeScript andban-types.

Fail

letnonNullish:Object;

Pass

letnonNullish:{};

Additional Info

For clarity, the intent of the two issues I'm filing are:

If this issue is resolved before#8697, that's great too.

Metadata

Metadata

Labels

accepting prsGo ahead, send a pull request that resolves this issueenhancement: plugin rule optionNew rule option for an existing eslint-plugin rulelocked 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-plugin

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp