Nucleus handler tools β€Ί Docs β€Ί Checks

A caught error overwritten

Warningno-ex-assignA general JavaScript mistake (ESLint's no-ex-assign) Β· Probably wrong: Nucleus runs it, but not the way you meant.

Why it matters

Overwriting the caught error loses it.

Example

βœ— Wrong

try {
  Game.MaxPlayers = 4;
} catch (e) {
  e = null;
}

βœ“ Right

try {
  Game.MaxPlayers = 4;
} catch (e) {
  var err = e;
}

How to fix it

Copy the error to a new variable instead.

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-ex-assign": "off" } in your settings. Notepad++: Plugins β€Ί Nucleus Co-op handlers β€Ί Settings. Command line: ncdev lint --rule no-ex-assign=off. Other editors: the lint.rules setting of ncdev lsp.

Is this right?
Stuck, or not sure? Ask other handler authors: Discordr/nucleuscoop