npm package: @prototwin/tinylint-rules
Description: Standard set of TinyLint rules for scripts written in ProtoTwin.
Latest version: 0.2.6

# ProtoTwin TinyLint Rules

This package includes the standard set of [TinyLint](https://npmjs.com/package/tinylint) rules for scripts written in [ProtoTwin](https://prototwin.com).

## Install

```bash
npm install @prototwin/tinylint-rules tinylint typescript
```

## Rules

### Errors

- `no-debugger`: Flags `debugger` statements.
- `no-duplicate-decorators`: Flags repeated use of the same decorator on a single declaration.
- `no-incomplete-io-property`: Requires `io` properties to expose both getter and setter accessors.
- `no-missing-export`: Requires component, tool, converter and custom IO types to be exported.
- `no-promises-in-non-async-functions`: Flags promise usage inside non-async functions.

### Warnings

- `no-inconsistent-type-imports`: Flags named imports that are only used in type positions.
- `no-condition-assignments`: Flags assignment expressions inside conditional tests.
- `no-dynamic-imports`: Flags dynamic `import(...)` calls.
- `no-explicit-any-or-unknown`: Flags explicit `any` and `unknown` type annotations.
- `no-for-in`: Flags use of `for...in` loops.
- `no-impossible-for-loop`: Flags `for` loops whose init, condition, and update cannot make progress.
- `no-loose-comparisons`: Flags `==` and `!=` in favor of strict equality.
- `no-nested-ternaries`: Flags nested ternary expressions.
- `no-private-properties`: Flags `private` properties, recommending private fields instead.
- `no-recursive-this-accessor`: Flags accessors that recursively read from or write to themselves.
- `no-redundant-property-decorators`: Flags redundant property decorators.
- `no-redundant-type-assertion`: Flags type assertions that do not change the type.
- `no-sparse-arrays`: Flags array literals with holes.
- `no-switch-fallthrough`: Flags `switch` cases that fall through without an explicit terminator.
- `no-trackable-properties-without-handle`: Flags properties of `ITrackable` types, recommending the use of `Handle<...>` instead.
- `no-trailing-commas-in-arguments`: Flags trailing commas in call argument lists.
- `no-trailing-commas-in-arrays`: Flags trailing commas in array literals.
- `no-trailing-commas-in-objects`: Flags trailing commas in object literals.
- `no-trailing-commas-in-parameters`: Flags trailing commas in function parameter lists.
- `no-truthy-checks`: Flags condition expressions that are not explicitly boolean.
- `no-unbraced-control-statements`: Flags `if`, `for`, and `while` statements whose bodies are not wrapped in curly braces.
- `no-unsafe-handle-initialization`: Flags potentially unsafe `Handle` initialization patterns.
- `no-var`: Flags use of `var`, recommending `const` or `let` instead.

### Suggestions

- `no-array-spread`: Recommends explicit loops instead of array spread in array literals.
- `no-filter`: Recommends explicit loops instead of `.filter()`.
- `no-flat-map`: Recommends explicit loops instead of `.flatMap()`.
- `no-for-each`: Recommends explicit loops instead of `.forEach()`.
- `no-map`: Recommends explicit loops instead of `.map()`.
- `no-missing-dropdown-decorator`: Recommends `@Dropdown` for public enum-typed properties.
- `no-missing-local-feature-decorator`: Recommends `@LocalFeature` for public properties of type `Vec3`.
- `no-missing-readonly-decorator`: Recommends `@ReadOnly` for public getter-only component properties.
- `no-missing-units-decorator`: Recommends `@Units` for public numeric properties with unit-like names.
- `no-reduce`: Recommends explicit loops instead of `.reduce()`.
- `no-reduce-right`: Recommends explicit loops instead of `.reduceRight()`.
- `no-shift`: Flags `.shift()` as a potentially inefficient array operation.
- `no-string-literal-unions`: Recommends enums instead of string-literal unions.
- `no-unshift`: Flags `.unshift()` as a potentially inefficient array operation.