Nucleus handler tools › Docs › Checks

A regular expression that never matches

Warningno-empty-character-classA general JavaScript mistake (ESLint's no-empty-character-class) · Probably wrong: Nucleus runs it, but not the way you meant.

Why it matters

[] in a regular expression matches nothing, so the whole expression never matches.

Example

✗ Wrong

var r = /a[]/;

✓ Right

var r = /a[b]/;

How to fix it

Put the characters to match inside [ ].

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