Nucleus handler tools › Docs › Checks

A condition that is always the same

Warningno-constant-conditionA general JavaScript mistake (ESLint's no-constant-condition) · Probably wrong: Nucleus runs it, but not the way you meant.

Why it matters

This condition is always the same, so one branch never runs. A common cause: = (assign) where == (compare) was meant.

Example

✗ Wrong

if (true) {
}

✓ Right

var on = Game.MaxPlayers > 2;
if (on) {
}

How to fix it

Test something that changes, or remove the condition.

Turn it off, or change how it shows

Each check can be shown as an error, warning, info or hint, or turned off. VS Code: "splitscreenme.lint.rules": { "no-constant-condition": "off" } in your settings. Notepad++: Plugins › Nucleus Co-op handlers › Settings. Command line: ncdev lint --rule no-constant-condition=off. Other editors: the lint.rules setting of ncdev lsp.

Is this right? Tell us what's wrong
Stuck, or not sure? Ask other handler authors: Discordr/nucleuscoop