Skip to content

Rule merger for @typescript-eslint/ban-types should deeply merge objects #1087

Open
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Overview

@typescript-eslint/ban-types has a fixWith option for types. https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/ban-types.md

Actual Behavior

That fixWith might go away if two rule arguments types lists are merged and the second doesn't have it.

First:

{
  types: [
    {
      fixWith: "number",
      typeName: "Number",
    },
  ];
}

Second:

{
  types: [
    {
      typeName: "Number",
    },
  ];
}

Output:

{
  types: [
    {
      typeName: "Number",
    },
  ];
}

Expected Behavior

The output should include fixWith if it exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: incorrect mergerRule merger with incomplete, incorrect, or invalid rule argumentsgood first issueGood for newcomers; welcome aboard!status: accepting prsPlease, send in a PR to resolve this! ✨

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions