Skip to content

Rule option proposal: ignore void returns or no-return functions for explicit-function-return-type #4826

@SamuelT-Beslogic

Description

@SamuelT-Beslogic

Description

Right now, I have to write the following with this rule (see Pass for how I'd like to write this). Even with all allow* options turned on.

const listener: (event: ClipboardEvent, link: string) => void = (event, link) => {
  event.clipboardData?.setData('text/plain', link);
  event.preventDefault();
};

Fail

const listener = (event: ClipboardEvent, link: string) => {
  event.clipboardData?.setData('text/plain', link);
  event.preventDefault();
  return true;
};

Pass

const listener = (event: ClipboardEvent, link: string) => {
  event.clipboardData?.setData('text/plain', link);
  event.preventDefault();
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already existspackage: 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