Skip to content

[ no-constant-condition] should validate 'void' too  #5726

@pvamshi

Description

@pvamshi

Request type : Enhancement

Rule : no-constant-condition

What version of ESLint are you using?
2.5.1

What parser (default, Babel-ESLint, etc.) are you using?
default

Please show your full configuration:

{
  "rules": {
    "no-constant-condition": 2   // disallow use of constant expressions in conditions
  }
}

What did you do? Please include the actual source code causing the issue.

if(void x){}
if (void x === void x){}

What did you expect to happen?
Error as it is a constant condition

What actually happened?
No error

As discussed in #5228 & #5696

Metadata

Metadata

Assignees

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionenhancementThis change enhances an existing feature of ESLintruleRelates to ESLint's core rules

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions