runtimeTypeofA `typeof` check narrows a representation without establishing its contract. Parse input at its I/O boundary, then branch on the domain value.small-rules/no-runtime-typeofDisallow runtime typeof checks; external values must be decoded into meaningful types at their I/O boundary.
Ported from dmmulroy/anti-slop. A typeof check narrows
a representation but doesn’t establish the value’s full contract. Parse at the I/O boundary instead. Set
allowInTypeGuards only for schema-free codebases that use type-predicate helpers.
runtimeTypeofA `typeof` check narrows a representation without establishing its contract. Parse input at its I/O boundary, then branch on the domain value.This rule accepts one options object after the severity.
if (typeof input === 'string') use(input);function isString(value: unknown): value is string { return typeof value === "string"; }