Nucleus handler tools › Docs › Checks

A ! in the wrong place

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

Why it matters

!a in b means (!a) in b; you probably meant !(a in b).

Example

✗ Wrong

var o = {};
if (!"a" in o) {
}

✓ Right

var o = {};
if (!("a" in o)) {
}

How to fix it

Put the brackets around the whole test: !(a in b).

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-unsafe-negation": "off" } in your settings. Notepad++: Plugins › Nucleus Co-op handlers › Settings. Command line: ncdev lint --rule no-unsafe-negation=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