no-constant-condition (ESLint: no-constant-condition)
disallow use of constant expressions in conditions (recommended)
A constant expression (for example, a literal) as a test condition might be a typo or development trigger for a specific behavior. For example, the following code looks as if it is not ready for production.
"checkLoops"
Setting this option tofalse
allows constant expressions in loops (default:true
).
"no-constant-condition": true
"no-constant-condition": [true, { "checkLoops": false }]
{
"type": "object",
"properties": {
"checkLoops": {
"type": "boolean"
}
},
"additionalProperties": false
}