Skip to content

linter: explicit-module-boundary-types/allowOverloadFunctions do not work as intended #20454

@kuainx

Description

@kuainx

What version of Oxlint are you using?

1.56.0

What command did you run?

pnpm oxlint

What does your .oxlintrc.json (or oxlint.config.ts) config file look like?

{
  "rules": {
    "typescript/explicit-module-boundary-types": [
      "error",
      {
        "allowOverloadFunctions": true
      }
    ]
  }
}

What happened?

// This function should raise an error, but have no error
export function add(a: number, b: number) {
  return a + b;
}

// This function works well with no error
export function plus(a: number, b: number): string;
export function plus(a: string, b: string): string;
export function plus(a: number | string, b: number | string) {
  return a.toString() + b.toString();
}

After enabling the "allowOverloadFunctions" option, it seems that all the exported functions no longer need to specify return types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions