Skip to content

No Ianitor Success Access

SuggestionRoblox
small-rules/no-ianitor-success-access

Disallow accessing `.success` on Ianitor check results when the full result object is not needed.

Diagnostic Messages

preferCreateGuard
Replace with Flamework.createGuard<T>(). Ianitor check results allocate a table on every call; Flamework.createGuard returns a plain boolean at runtime with zero allocation.

Configuration

This rule does not accept options.

{
"jsPlugins": [
"@pobammer-ts/small-rules"
],
"rules": {
"small-rules/no-ianitor-success-access": "error"
}
}

Examples

Ianitor success property access
import { Ianitor } from "@packages/ianitor";
const ids = { a: "a", b: "b" } as const;
const validator = Ianitor.keyOf(ids);
export function isX(value: unknown) {
return validator(value).success;
}
validator without success access
import { Ianitor } from "@packages/ianitor";
const ids = { a: "a", b: "b" } as const;
const validator = Ianitor.keyOf(ids);