Skip to content

Overload signatures causes [no-redeclare]error from eslint #129

@chancancode

Description

@chancancode

Haven't had a chance to test this in an isolated reproduction, so I'm not 100% sure if this is a problem with the eslint plugin or the eslint parser.

export function foo(arg: string): string;
export function foo(arg: number): number;
export function foo(arg: string | number): string | number {
  throw "not implemented";
}

This works fine with a .ts extension, but if you rename it to .gts extension it gives error 'foo' is already defined no-redeclare.

Seems like possibly a parser issue, but AFAIK the parser largely delegates to the eslint TS parser, and I am using the ember-eslint-parser globally (for js/ts/gjs/gts files) since it is supposed to work just fine (and did here) on regular non-glimmerized files. I suppose it's possible that the something went slightly wrong in the AST translation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions