Skip to content

Docs: Add explanation of the differences & preference between interfaces and types in consistent-type-definitions #10227

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Before You File a Documentation Request Please Confirm You Have Done The Following...

Suggested Changes

@typescript-eslint/consistent-type-definitions enforces type definitions to consistently use either interface or type. But the page doesn't link to a real explanation of what the differences are or how you might choose one vs. the other as your default. It doesn't even explain why the rule prefers interface as a default.

Proposal: let's add in:

  • An explanation of why the rule has 'interface' as its default
  • Links to resources explaining the differences between the two, including any official TypeScript docs & recommendations

Affected URL(s)

https://typescript-eslint.io/rules/consistent-type-definitions

Additional Info

There's no one link I can find online that's exactly what I'm hoping for...

💖

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationDocumentation ("docs") that needs adding/updatinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.team assignedA member of the typescript-eslint team should work on this.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions