# eslint-plugin-botland

> Lint your botland JS scripts

Latest version **3.1.0** (published 2019-10-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-botland
pnpm add eslint-plugin-botland
yarn add eslint-plugin-botland
bun add eslint-plugin-botland
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.1.0 |
| Published | 2019-10-12 |
| First published | 2018-08-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10.0.0 |
| Dependencies | 0 |
| Unpacked size | 47.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Martin Giger |
| Maintainers | freaktechnik |
| Keywords | eslint, eslintplugin, botland |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-botland
- Repository: https://github.com/freaktechnik/eslint-plugin-botland
- Homepage: https://github.com/freaktechnik/eslint-plugin-botland#readme
- Issues: https://github.com/freaktechnik/eslint-plugin-botland/issues
- npm.io page: https://npm.io/package/eslint-plugin-botland

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 3.1.0 (latest) — 2019-10-12
- 3.0.1 — 2019-04-17
- 3.0.0 — 2019-02-15
- 2.1.0 — 2018-09-04
- 2.0.1 — 2018-09-02
- 2.0.0 — 2018-09-01
- 1.3.0 — 2018-08-28
- 1.2.0 — 2018-08-27
- 1.1.0 — 2018-08-27
- 1.0.0 — 2018-08-27

## README

# eslint-plugin-botland

[![Build Status](https://travis-ci.com/freaktechnik/eslint-plugin-botland.svg?branch=master)](https://travis-ci.com/freaktechnik/eslint-plugin-botland) [![Greenkeeper badge](https://badges.greenkeeper.io/freaktechnik/eslint-plugin-botland.svg)](https://greenkeeper.io/)

Lint your BotLandScript bot scripts for [Bot Land](https://bot.land) using eslint.

## Rules

- `code-length`
  Bot Land scripts can at most have 16500 characters
- `entry-point`
  Check that the script has the required `update` function. Marks all entry points as used.
- `no-args-in-entry-point`
  Entry points get passed no arguments.
- `no-big-array`
  Items on arrays can only be assigned to indexes between 0 and 99.
- `no-code-after-terminator`
  Warn about code after terminators, since it may not always be reached.
- `no-terminator-in-init`
  Terminators in the init entry point are a no-op.
- `no-unreachable-code`
  Check for code that is never reached via entry points.
- `no-unset`
  Check for variables to be set when read and functions to be defined on the top level scope.
- `no-unsupported-syntax`
  Check for unsupported JS syntax features.
- `no-terminator-expression`
  Terminators must always be a statement on their own line.
- `no-call-entry`
  Don't manually invoke entry points.
- `only-global-function-declaration`
  Top level code must be function declarations and function declarations must be on the top level.
- `prefer-anything`
  Prefer the shorter `ANYTHING` over its equivalent `CPU | BOT | CHIP`.
- `prefer-function`
  Enforce function name to use for aliased functions. Can take an option object with two properties: `exclude` and `prefer`. Both take an array of strings. Functions listed in `exclude` are ignored by the rule. Functions listed in `prefer` are preferred over the default name of the function.
- `use-array-variables`
  There are two special variables in Bot Land, `array1` and `array2` to access and mutate arrays. Arrays can not be interacted with in any other way.

### Future rules to add

- `arg-types` Check 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-length` `debugLog` strings can at most have 50 characters.
- `no-nan-in-init` warns about `getX`/`getY` resp. `entity.x`/`entity.y` being `NaN` inside the `init` code path.
- `no-reassign-loopvar-in-call` warns about loop variables being reset in a function called within the loop.
- `prefer-find-entities` prefer (or not) `findEntities` over `findClosest*` functions.

## Configs

- `recommended`
  Adds 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     |

---
_Source: https://npm.io/package/eslint-plugin-botland · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
