Configuration
Add the plugin
Section titled “Add the plugin”Register the plugin in your Oxlint configuration file:
{ "jsPlugins": [ "@pobammer-ts/small-rules" ]}import { defineConfig } from "oxlint";
export default defineConfig({ jsPlugins: ["@pobammer-ts/small-rules"],});Choose rule severity
Section titled “Choose rule severity”Start new rules as warnings, then promote the ones you want CI to enforce. error fails the lint check, warn reports the problem without failing, and off turns the rule off.
Each rule uses one of three severity levels:
| Severity | Behavior |
|---|---|
"error" |
Fails the lint check |
"warn" |
Shows a warning but doesn’t fail |
"off" |
Turns the rule off |
{ "rules": { "small-rules/no-print": "error", "small-rules/prefer-early-return": "warn", "small-rules/no-useless-constants": "off" }}import { defineConfig } from "oxlint";
export default defineConfig({ 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”Some rules accept options. 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 } ] }}import { defineConfig } from "oxlint";
export default defineConfig({ rules: { "small-rules/ban-instances": [ "error", { ban: ["ScreenGui", "Frame"], }, ], "small-rules/no-god-components": [ "error", { maxLines: 200, maxProps: 8, }, ], },});Plugin settings
Section titled “Plugin settings”Some behavior can’t live on one rule. Oxlint exposes a top-level settings object for that, keyed by plugin name:
{ "jsPlugins": [ "@pobammer-ts/small-rules" ], "settings": { "small-rules": { "tsgolintVersion": "7.0.2002" } }}import { defineConfig } from "oxlint";
export default defineConfig({ jsPlugins: ["@pobammer-ts/small-rules"], settings: { "small-rules": { tsgolintVersion: "7.0.2002", }, },});| Setting | Type | Default | Used by |
|---|---|---|---|
tsgolintVersion |
string |
inferred | require-safety-comment-for-type-assertion |
The tsgolintVersion setting
Section titled “The tsgolintVersion setting”This setting is how the rule picks where a suppression comment has to sit to count as justification for a type assertion.
- Before
7.0.2002, the linter reports the containing statement, so adisable-next-linecomment on the preceding line covers the diagnostic. - On
7.0.2002and later, the linter reports theasexpression itself, so the comment has to cover the assertion line instead.
When you omit the setting, the version comes from this order:
- The installed version in
node_modules/oxlint-tsgolint - The catalog entry in
pnpm-workspace.yaml - The version range in
package.json
Values that aren’t a version string fall back to the same lookup.
Override files
Section titled “Override files”Use oxlint’s overrides field to apply different rules to different file patterns:
{ "overrides": [ { "files": [ "**/*.test.ts" ], "rules": { "small-rules/no-print": "off" } } ]}import { defineConfig } from "oxlint";
export default defineConfig({ overrides: [ { files: ["**/*.test.ts"], rules: { "small-rules/no-print": "off", }, }, ],});Turn a rule off inline
Section titled “Turn a rule off inline”Sometimes a violation is intentional. Turn off only that line when possible:
// 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, start with a small set of rules for noisy output and unsafe waits. Add the rest as you run into a reason to use them.
{ "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" }}import { defineConfig } from "oxlint";
export default defineConfig({ 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", },});