Skip to content

Enforce Ianitor Check Type

ErrorRoblox
small-rules/enforce-ianitor-check-type

Enforce Ianitor.Check<T> type annotations on complex TypeScript types

Diagnostic Messages

complexInterfaceNeedsCheck
Interface '{{name}}' requires Ianitor.Check<T> annotation (interfaces always need explicit checking)
missingIanitorCheckType
Complex type (score: {{score}}) requires Ianitor.Check<T> annotation for type safety

Configuration

This rule accepts one options object after the severity.

baseThresholdOptional

Minimum complexity score before missing Ianitor.Check<T> annotations are reported.

errorThresholdOptional

Complexity score used to cap recursive analysis before reporting is determined.

interfacePenaltyOptional

Complexity penalty applied when an Ianitor validator builds an interface-like shape.

performanceModeOptional

Whether repeated type nodes are cached during complexity analysis.

{
"jsPlugins": [
"@pobammer-ts/small-rules"
],
"rules": {
"small-rules/enforce-ianitor-check-type": [
"error",
{
"baseThreshold": 10,
"errorThreshold": 25,
"interfacePenalty": 20,
"performanceMode": true
}
]
}
}

Examples

Ianitor schema without check type
const isUser = Ianitor.strictInterface({
name: Ianitor.string,
age: Ianitor.number,
profile: Ianitor.interface({
email: Ianitor.string,
settings: Ianitor.record(Ianitor.string, Ianitor.unknown),
}),
});
explicit Ianitor check type
const validator: Ianitor.Check<User> = Ianitor.interface({ name: Ianitor.string });