Configuration
Add the plugin
Section titled “Add the plugin”I keep the plugin registration separate from the rules themselves so I can add or remove the rules I actually want. Register it in your .oxlintrc.json:
Register the plugin in your .oxlintrc.json:
{ "jsPlugins": ["@pobammer-ts/small-rules"]}Choose rule severity
Section titled “Choose rule severity”I usually start new rules as warnings, then promote the ones I want CI to enforce. error fails the lint check, warn reports the problem without failing, and off disables the rule.
Each rule can be set to one of three severity levels:
| Severity | Behavior |
|---|---|
"error" |
Fails the lint check |
"warn" |
Shows a warning but does not fail |
"off" |
Disables the rule |
{ "rules": { "small-rules/no-print": "error", "small-rules/prefer-early-return": "warn", "small-rules/no-useless-constants": "off" }}Pass rule options
Section titled “Pass rule options”Most rules do not need configuration. When one does, pass the severity first and the options object second:
Some rules accept options for customization. Pass them as an array where the first element is the severity and the second is an options object:
{ "rules": { "small-rules/ban-instances": [ "error", { "ban": ["ScreenGui", "Frame"] } ], "small-rules/no-god-components": [ "error", { "maxLines": 200, "maxProps": 8 } ] }}Override files
Section titled “Override files”Use oxlint’s overrides field when a rule makes sense for application code but not for tests or generated files:
Use oxlint’s overrides field to apply different rules to different file patterns:
{ "overrides": [ { "files": ["**/*.test.ts"], "rules": { "small-rules/no-print": "off" } } ]}Disable a rule inline
Section titled “Disable a rule inline”Sometimes a violation is intentional. Disable only that line when possible:
You can disable rules for specific lines using directive comments:
// oxlint-disable-next-line small-rules/no-printprint("Debug output");Use oxlint-enable to re-enable:
/* oxlint-disable small-rules/no-print */print("Debug 1");print("Debug 2");/* oxlint-enable small-rules/no-print */A starting configuration
Section titled “A starting configuration”For most roblox-ts projects, I would start with a small set of rules that catch noisy output, unsafe waits, and patterns I do not want spreading through the codebase. Add the rest as you run into a reason to use them.
For most roblox-ts projects, start with this baseline:
{ "jsPlugins": ["@pobammer-ts/small-rules"], "rules": { "small-rules/no-print": "error", "small-rules/no-warn": "error", "small-rules/no-error": "error", "small-rules/no-task-wait": "error", "small-rules/ban-react-fc": "error", "small-rules/no-unused-imports": "error", "small-rules/prefer-early-return": "warn" }}