Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[unified-signatures] Don't trigger on mergeable declaration with different parameter nameΒ #2386

Closed
@sindresorhus

Description

@sindresorhus

Repro

{
  "rules": {
    "@typescript-eslint/unified-signatures": "error"
  }
}
declare const findUp: {
	(name: string | readonly string[], options?: findUp.Options): Promise<string | undefined>;

	(matcher: (directory: string) => (findUp.Match | Promise<findUp.Match>), options?: findUp.Options): Promise<string | undefined>;
};

Expected Result

I expected it not to be a violation as a different parameter name is a good indication that the overloads are not compatible.

Actual Result

  βœ–   57:4  These overloads can be combined into one signature taking string | string[] | (directory: string) => findUp.Match.                            @typescript-eslint/unified-signatures
  βœ–  134:3  These overloads can be combined into one signature taking string | string[] | (directory: string) => (findUp.Match | Promise<findUp.Match>).  @typescript-eslint/unified-signatures

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 3.9.0
@typescript-eslint/parser 3.9.0
TypeScript 3.9.7
ESLint 7.6.0
node 10.22.0
npm 6.14.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issueenhancement: plugin rule optionNew rule option for an existing eslint-plugin rulepackage: 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