biome-plugin-roblox-ts
v0.1.12
Published
Biome GritQL rules for roblox-ts projects
Maintainers
Readme

biome-plugin-roblox-ts
A port of the eslint-plugin-roblox-ts ruleset to Biome. Designed for roblox-ts development.
This plugin enforces TypeScript restrictions, Lua compatibility patterns, and Roblox-specific best practices to help you write better roblox-ts code.
✨ Features
- ⚡ Automatic Setup - Postinstall script automatically configures your
biome.json - 🎯 TypeScript Focused - Enforces roblox-ts TypeScript restrictions
- 🌙 Lua Compatible - Prevents patterns that don't translate well to Lua
- 🎮 Roblox Specific - Rules tailored for the Roblox platform
📦 Installation
1. Install Biome and the Plugin
# npm
npm install --save-dev @biomejs/biome biome-plugin-roblox-ts
# bun
bun add -D @biomejs/biome biome-plugin-roblox-ts
# yarn
yarn add -D @biomejs/biome biome-plugin-roblox-ts2. Initialize Biome (if not already done)
npx @biomejs/biome init3. Install Biome VS Code Extension
Install the Biome VS Code extension for IDE integration:
- Open VS Code
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "Biome"
- Install the official Biome extension by the Biome team
🎛️ Configuration
After installation, add the plugin to your biome.json configuration:
{
"extends": ["biome-plugin-roblox-ts/biome"],
}Customizing Rules
You can disable specific rules or change their severity by overriding them in your biome.json:
{
"linter": {
"rules": {
"nursery": {
"noNull": "off",
"noAnyType": "warn"
}
}
}
}📋 Rules Overview
Built-in Biome Rules (4 rules)
These rules are provided by Biome itself and are enabled as warnings in the plugin configuration:
noDebugger- Bans debugger statementsnoDelete- Bans delete operatornoNonNullAssertion- Bans ! assertion operatornoWithStatement- Bans with statements
Core Language Features (7 rules)
noGlobalThis- Bans globalThis usagenoNull- Bans null usage (use undefined instead)noVoidExpression- Bans void expressionsnoValueTypeOf- Bans typeof operatornoPrototype- Bans .prototype accessnoLabels- Bans labeled statementsnoForIn- Bans for-in loops (use for-of instead)noRegex- Bans regex literals
Operators & Expressions (6 rules)
noEqualityOperators- Bans == operator (use === instead)noInequalityOperators- Bans != operator (use !== instead)noObjectMath- Bans + operator on Roblox data typesnoMathSub- Bans - operator (use .sub() method)noMathMul- Bans * operator (use .mul() method)noMathDiv- Bans / operator (use .div() method)
TypeScript Features (6 rules)
noAnyType- Bans any type (use unknown instead)noEnumMerging- Bans enum declarationsnoNamespaceMerging- Bans namespace declarationsnoPrivateIdentifier- Bans # private fieldsnoGettersOrSetters- Bans getter methodsnoSetters- Bans setter methods
Roblox-Specific (8 rules)
noArrayPairs- Bans pairs() function on arraysnoArrayIPairs- Bans ipairs() function on arraysnoRbxPostFixNew- Bans .new() method calls (use new X() instead)preferTaskLibrary- Prefers task library over coroutinerequireModule- Prefers import statements over require()noReservedLuaKeywords- Bans Lua reserved keywords as identifiersnoLuaKeywordEnd- Bans 'end' keyword usagenoLuaKeywordLocal- Bans 'local' keyword usagenoLuaKeywordNil- Bans 'nil' keyword usage
Control Flow & Patterns (11 rules)
luaTruthiness- Warns about falsy values in conditionsluaTruthinessZero- Warns about 0 in if statementsluaTruthinessNaN- Warns about NaN in if statementsnoUndefinedReturn- Bans explicit undefined returnsnoArrayAccess- Bans string literal array accessnoSpreadDestructuring- Bans spread in destructuringnoSpreadingTuples- Bans spreading tuplesnoFunctionExpressionName- Bans named function expressionsnoExportAssignmentLet- Bans export = syntaxnoPrecedingSpreadElement- Enforces spread comes last in arguments
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📄 License
MIT License - see LICENSE for details.
🔗 Related Projects
- roblox-ts - TypeScript to Lua compiler for Roblox
- Biome - Fast formatter and linter for web projects
- GritQL - Pattern matching language for code
Made with ❤️ for the roblox-ts community
