Skip to content

Configuration

Register the plugin in your Oxlint configuration file:

{
"jsPlugins": [
"@pobammer-ts/small-rules"
]
}

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"
}
}

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
}
]
}
}

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"
}
}
}
Setting Type Default Used by
tsgolintVersion string inferred require-safety-comment-for-type-assertion

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 a disable-next-line comment on the preceding line covers the diagnostic.
  • On 7.0.2002 and later, the linter reports the as expression itself, so the comment has to cover the assertion line instead.

When you omit the setting, the version comes from this order:

  1. The installed version in node_modules/oxlint-tsgolint
  2. The catalog entry in pnpm-workspace.yaml
  3. The version range in package.json

Values that aren’t a version string fall back to the same lookup.

Use oxlint’s overrides field to apply different rules to different file patterns:

{
"overrides": [
{
"files": [
"**/*.test.ts"
],
"rules": {
"small-rules/no-print": "off"
}
}
]
}

Sometimes a violation is intentional. Turn off only that line when possible:

// oxlint-disable-next-line small-rules/no-print
print("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 */

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"
}
}