Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

[Feat] Allow return void for rules noSetterReturn noConstructorReturn noVoidTypeReturn #3827

Description

@Conaclos

Description

Keywords

linter, rules, return, void, noSetterReturn, noConstructorReturn, noVoidTypeReturn

Summary

This issue is open for gathering opinions and interest about the support
of return void in the following rules:

Currently, these rules disallow any return statement with an argument.
Only returning without argument is allowed.

The rule could be relaxed for supporting return void.

class A {
  constructor() {
    this._prop = 0;
    return void 0;
  }

  set prop(prop: number) {
    this._prop = prop;
    return void 0;
  }

  function f(): void {
    return 0;
  }
}

Note: currently, ESLint does not support return void.

Metadata

Metadata

Assignees

No one assigned

    Labels

    taskA task, an action that needs to be performed

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions