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

Rule proposal: enforce complete destructuring of parameters #1328

Open
Labels
accepting prsGo ahead, send a pull request that resolves this issueenhancement: new plugin ruleNew rule request for eslint-pluginpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
@whatisaphone

Description

@whatisaphone

Consider this code:

functionButton({ text}:{text:string;onClick:()=>void;}){return<button>{text}</button>;}

TheonClick prop was accidentally omitted, and no current rule is able to catch it (that I know of). I suggest a rule, called maybefully-destructure-arguments, which would trigger if a property is present on an object type, but is not destructured.

It (probably) shouldn't trigger for interfaces et al, only immediate inline object types. An interface may be used elsewhere, but an inline object type is only used in one place, so if it's destructured and is missing a prop, the forgotten prop is guaranteed never to be used.

Bikeshedding is welcome on the rule name or the suggestion in general.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issueenhancement: new plugin ruleNew rule request for eslint-pluginpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    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