Skip to content

[explicit-module-boundary-types] New option to allow unspecified return type if there are overload signatures #4586

Closed
@Josh-Cena

Description

@Josh-Cena
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

Playground

{
  "rules": {
    "@typescript-eslint/explicit-module-boundary-types": "error"
  }
}
export function foo(a: string): string;
export function foo(a: number): number;
export function foo(a: unknown) {
  return a;
}

Expected Result

I'd like a new option that makes this code pass, since the implementation signature is not visible to the outside, while the boundary, defined by the overload signatures, is well-typed.

Actual Result

This errors, even with all the allow* options turned on.

Versions

package version
@typescript-eslint/eslint-plugin 5.12.1
@typescript-eslint/parser 5.12.1
TypeScript 4.5.5
ESLint 8.9.0
node 17.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issueenhancementNew feature or requestlocked 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