eslint-plugin-botland
v3.1.0
Published
Lint your botland JS scripts
Downloads
4
Maintainers
Readme
eslint-plugin-botland
Lint your BotLandScript bot scripts for Bot Land using eslint.
Rules
code-lengthBot Land scripts can at most have 16500 charactersentry-pointCheck that the script has the requiredupdatefunction. Marks all entry points as used.no-args-in-entry-pointEntry points get passed no arguments.no-big-arrayItems on arrays can only be assigned to indexes between 0 and 99.no-code-after-terminatorWarn about code after terminators, since it may not always be reached.no-terminator-in-initTerminators in the init entry point are a no-op.no-unreachable-codeCheck for code that is never reached via entry points.no-unsetCheck for variables to be set when read and functions to be defined on the top level scope.no-unsupported-syntaxCheck for unsupported JS syntax features.no-terminator-expressionTerminators must always be a statement on their own line.no-call-entryDon't manually invoke entry points.only-global-function-declarationTop level code must be function declarations and function declarations must be on the top level.prefer-anythingPrefer the shorterANYTHINGover its equivalentCPU | BOT | CHIP.prefer-functionEnforce function name to use for aliased functions. Can take an option object with two properties:excludeandprefer. Both take an array of strings. Functions listed inexcludeare ignored by the rule. Functions listed inpreferare preferred over the default name of the function.use-array-variablesThere are two special variables in Bot Land,array1andarray2to access and mutate arrays. Arrays can not be interacted with in any other way.
Future rules to add
arg-typesCheck argument count and types for methods. Should at the very least be able to check number of args, type of literals and direction literals.string-lengthdebugLogstrings can at most have 50 characters.no-nan-in-initwarns aboutgetX/getYresp.entity.x/entity.ybeingNaNinside theinitcode path.no-reassign-loopvar-in-callwarns about loop variables being reset in a function called within the loop.prefer-find-entitiesprefer (or not)findEntitiesoverfindClosest*functions.
Configs
recommendedAdds all the global functions and variables of Bot Land so eslint doesn't complain about them, removes all the ECMA Script globals and adds the following rules:| Rule | Level | Fixable | |------------------------------------|---------|---------| |
code-length| error | No | |entry-point| error | No | |no-unsupported-syntax| error | No | |only-global-function-declaration| error | No | |use-array-variables| error | No | |no-big-array| error | No | |no-unset| error | No | |no-unreachable-code| error | No | |no-terminator-expression| error | No | |no-call-entry| error | No | |no-terminator-in-init| warning | No | |prefer-function| warning | Yes | |no-code-after-terminator| warning | No | |prefer-anything| warning | Yes |
