Nucleus handler tools › Docs › Checks
Every check
What the tools check in a handler, one page each: what it means, why Nucleus cares, an example and the fix. The same checks run in VS Code, Notepad++, the workbench and ncdev lint.
Nucleus checks
- Code that can't be readError
syntax-errorThe handler isn't valid JavaScript, so Nucleus can't load it at all: the game disappears from its list. - Newer JavaScript than Nucleus understandsError
es5-onlyNucleus runs handlers with Jint 2.11.58, which only reads ES5 (plusletandconst). letandconstwork likevarhereInfolet-const-semanticsJint 2.x acceptsletandconstbut treats them exactly likevar: they belong to the whole function, not the block, and aconstcan be changed.- A name Nucleus doesn't haveWarning
unknown-memberThis option or method doesn't exist on that Nucleus object, usually a typo. - A value Nucleus sets itselfWarning
readonly-memberNucleus computes this value (a player's index, the screen size…); setting it from the handler is ignored. - The wrong kind of valueWarning
type-mismatchNucleus expects another type here (a number, true/false, a list…). - The value has the wrong formError
value-formatSome text options have a fixed form (CustomHotkeys, CopyFoldersTo, SteamlessPatch, BinariesFolder…). - A call with the wrong number of valuesError
wrong-argumentsJint only finds a Nucleus method when you pass exactly as many values as one of its versions takes (default values in C# don't count). - A required option is missingError
missing-requiredNucleus needs Game.GUID, Game.GameName and Game.ExecutableName to load a handler; without one, the game doesn't appear. - Game or Context replacedError
replaces-nucleus-objectNucleus gives the handler its own Game and Context and reads the settings from those. - Code in the wrong placeError
callback-only-globalContext, Player, PlayerList, Handler and ProtoInput only exist while Nucleus runs a callback such as Game.Play. - An option set too lateWarning
too-lateNucleus reads some options (GUID, GameName, MaxPlayers, AddOption…) before any player starts. - The same option set twiceWarning
duplicate-assignmentOnly the last value counts, so the first line does nothing. - A line the Hub install misreadsWarning
hub-install-parseWhen a handler is installed from the Hub, Nucleus finds Game.GameName and Game.ExecutableName by reading lines that start with them and taking the text between the first and last double quote. - Characters a folder name can't haveInfo
guid-charactersGame.GUID becomes a folder name in Nucleus. - Old input options fighting Proto InputWarning
protoinput-legacy-hooksWith Proto Input and several keyboards and mice, the old input options (Game.HookGetCursorPos, Game.SendNormalMouseInput…) must be off: several default to on and get in Proto Input's way. - Proto Input options that never startWarning
protoinput-inactiveProto Input only starts with Game.ProtoInput.InjectStartup or one of the InjectRuntime_… options. - A message filter without its hookWarning
protoinput-needs-hookGame.ProtoInput.BlockedMessages and the message filters only act inside Proto Input's message filter hook; without that hook they do nothing. - A message Proto Input can't blockWarning
blocked-messageProto Input looks blocked messages up in its own list. - An option that needs another oneWarning
needs-optionNucleus only reads some options when another is on: FakeFocusInterval needs FakeFocus, SteamlessArgs needs UseSteamless, and so on. - A GUID that differs from the HubWarning
guid-changedNucleus keys a user's game, profiles, cover and content folder by Game.GUID. - A file that isn't UTF-8Warning
file-encodingNucleus reads handlers as UTF-8. - A name that doesn't existError
undefined-nameNothing declares this name and Nucleus doesn't provide it: a typo, a stray word or a variable from another handler. - A JavaScript function Nucleus doesn't haveError
missing-builtinJint 2.x only has ES5's built-in functions. - A callback Nucleus never runsWarning
callback-misuseSome callbacks never run (Game.SetupSse), or run under conditions that can't happen (Game.Play with both GamePlayBeforeGameSetup and GamePlayAfterLaunch on). - An option compared as a number or booleanWarning
option-compareWhen the player starts from a saved profile, Nucleus gives every Game.AddOption value back as text: 4 becomes "4", true becomes "True". - A deprecated optionHint
deprecatedNucleus still reads this option but it has a replacement, or it is kept only for old handlers.
General JavaScript mistakes
- An assignment where a comparison was meant?Warning
no-cond-assignA single=inside a condition assigns: the condition is the assigned value. - A condition that is always the sameWarning
no-constant-conditionThis condition is always the same, so one branch never runs. - The same key twice in an objectWarning
no-dupe-keysAn object can't have the same key twice: the later value replaces the earlier one. - The same case twiceWarning
no-duplicate-caseOnly the first of two identicalcases ever runs. - An else-if that can never runWarning
no-dupe-else-ifThiselse iftests what an earlier branch already caught, so it never runs. - Two parameters with the same nameWarning
no-dupe-argsTwo parameters with the same name: the second hides the first. - A comparison with NaNWarning
use-isnanNothing equals NaN, not even NaN: this comparison is always false. - A typeof check that is never trueWarning
valid-typeoftypeofonly gives "undefined", "object", "boolean", "number", "string" or "function": this comparison is never true (a typo?). - Code that never runsWarning
no-unreachableNothing afterreturn,throw,breakorcontinueruns. - A line that does nothingWarning
no-unused-expressionsThis line computes something and throws the result away: it does nothing. - A value assigned to itselfWarning
no-self-assignAssigning a value to itself does nothing. - A value compared with itselfWarning
no-self-compareComparing something with itself is always the same; probably a typo. - A ! in the wrong placeWarning
no-unsafe-negation!a in bmeans(!a) in b; you probably meant!(a in b). - A comparison with -0Info
no-compare-neg-zerox === -0is also true for 0. - An invalid regular expressionError
no-invalid-regexpThis regular expression is invalid: it throws when that line runs. - A regular expression that never matchesWarning
no-empty-character-class[]in a regular expression matches nothing, so the whole expression never matches. - A control character in a regular expressionInfo
no-control-regexA control character in a regular expression is almost always a mistake (a lost backslash). - A hole in a listWarning
no-sparse-arraysTwo commas in a row leave a hole (undefined) in the array; usually a typo. - A backslash that disappearsWarning
no-useless-escapeIn a string a backslash only escapes some characters: here it disappears. - A backslash before a numberWarning
no-octal-escapeA backslash before a digit in a string is a character code, not a backslash:"\\45", not"\45"(which is "%"). - A number too precise for JavaScriptWarning
no-loss-of-precisionJavaScript numbers can't hold this value exactly: it is silently rounded. - A loop that counts the wrong wayWarning
for-directionThe counter moves away from the end condition, so the loop never stops (or never runs). - A return inside finallyWarning
no-unsafe-finallyAreturn/throwinfinallyoverrides the one intry/catch, hiding errors. - A function overwrittenWarning
no-func-assignThis overwrites a function declared with the same name. - A caught error overwrittenWarning
no-ex-assignOverwriting the caught error loses it. - Math or JSON called as a functionError
no-obj-callsMathandJSONare objects, not functions: calling them throws. - A variable named undefined, NaN or InfinityWarning
no-shadow-restricted-namesNaming a variableundefined,NaNorInfinitychanges what that name means everywhere after.