Skip to content

Enhancement: [no-unsafe-declaration-merging] dissallow interface declaration merging #11297

Closed as not planned
@AlexanderHott

Description

@AlexanderHott

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-unsafe-declaration-merging/

Description

For most application code, interface declaration merging is probably an accidental name conflict instead of the intended usage. I propose to either change the default behavior of no-unsafe-declaration-merging, or add an option disallowing interface-interface declaration merging.

Changing the default value might be a breaking change, so adding an option seems like a better way to move forward.

Fail

interface Foo {
  x: string;
}

interface Foo {
  y: number;
}

Pass

interface Foo {
  x: string;
  y: number;
}

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already existsenhancement: 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

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions