Skip to content

Introduction

Getting started

Introduction

What small-rules is, why it exists, and how it fits into the roblox-ts toolchain.

I made @pobammer-ts/small-rules for TypeScript projects that use roblox-ts and React Luau. It adds rules for the APIs and conventions that a general linter cannot understand, while still using oxlint for the ordinary JavaScript and TypeScript work.

Use it with oxlint 1.69.0 or later, TypeScript 5 through 7, and Node.js ^20.19.0 or >=22.12.0.

I chose oxlint because it is a Rust-based linter with a native plugin API. That gives me a place to put roblox-ts-specific checks without rebuilding the project around ESLint compatibility. I would not claim every rule is useful to every project, but the ones here come from patterns I actually want called out.

The rules are organized into 5 categories:

  • Use the native API: I want these rules to run as oxlint rules, not as an ESLint-shaped layer bolted on afterward.
  • Know the platform: Ianitor, Color3, UDim2, task.wait(), and React Luau components are not ordinary TypeScript patterns. A plugin for roblox-ts needs to understand that.
  • Keep configuration small: Most rules should work without options. I add configuration when a project genuinely needs a choice, not to make every rule look flexible.
  • Fix the boring parts: Where a fix is safe, I would rather let oxlint --fix handle it than make someone rewrite the same cleanup by hand.

This project overlaps with general Oxlint rules in a few places. The point is not to replace those rules. It is to cover the roblox-ts and React Luau cases they cannot reasonably know about.

small-rules requires:

  • oxlint 1.x (developed and tested against 1.71.0)
  • TypeScript >=5 <8 (for roblox-ts projects)
  • Node.js ^20.19.0 || >=22.12.0
  • An oxlint configuration file (.oxlintrc.json or oxlint.config.ts)