Nucleus handler tools › Docs › Checks

The same key twice in an object

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

Why it matters

An object can't have the same key twice: the later value replaces the earlier one.

Example

✗ Wrong

var o = { a: 1, a: 2 };

✓ Right

var o = { a: 1, b: 2 };

How to fix it

Give each key its own name, or keep one.

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