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

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Closed
Conaclos opened this issue Nov 22, 2022 · 1 comment
Labels
task A task, an action that needs to be performed

Comments

@Conaclos
Copy link
Contributor

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.

@Conaclos Conaclos added the task A task, an action that needs to be performed label Nov 22, 2022
@Conaclos Conaclos changed the title 📎 Allow return void for linter rules noSetterReturn noConstructorReturn and noVoidTypeReturn [Feat] Allow return void for linter rules noSetterReturn noConstructorReturn and noVoidTypeReturn Nov 22, 2022
@Conaclos Conaclos changed the title [Feat] Allow return void for linter rules noSetterReturn noConstructorReturn and noVoidTypeReturn [Feat] Allow return void for rules noSetterReturn noConstructorReturn noVoidTypeReturn Nov 22, 2022
@github-actions
Copy link

github-actions bot commented Dec 7, 2022

👋 @rome/staff please triage this issue by adding one of the following labels: S-Bug: confirmed, S-Planned , S-Wishlist or umbrella

@rome rome locked and limited conversation to collaborators Dec 12, 2022
@ematipico ematipico converted this issue into discussion #4047 Dec 12, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
task A task, an action that needs to be performed
Projects
None yet
Development

No branches or pull requests

1 participant