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: [no-empty-object-type] Checks for generated empty-object-type #10619

Open
Labels
enhancement: plugin rule optionNew rule option for an existing eslint-plugin ruleevaluating community engagementwe're looking for community engagement on this issue to show that this problem is widely importantpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugintriageWaiting for team members to take a look
@yeonjuan

Description

@yeonjuan

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/no-empty-object-type/

Description

I suggest that theno-empty-object-type rule also disallows{} generated by type transformations.
For example, usingOmit<V,K> on a type that is nullable will unintentionally create a{} type.

typeNullableData=null|{name:string;num:number};typeITS_EMPTY_OBJECT_TYPE=Omit<NullableData,'name'>;// '{}'

Fail

typeData={name:string;num:number};typeNullableData=null|Data;functiondoSomething<TextendsOmit<NullableData,'name'>// lint error>(param:T){}typeUnexpected=Omit<NullableData,'name'>;// lint error

Pass

typeData={name:string;num:number};functiondoSomething<TextendsOmit<Data,'name'>>(param:T){}typeExpected=Omit<Data,'name'>;

Additional Info

Perhaps it would be appropriate to handle this in no-unsafe-*?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement: plugin rule optionNew rule option for an existing eslint-plugin ruleevaluating community engagementwe're looking for community engagement on this issue to show that this problem is widely importantpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugintriageWaiting 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