What it flags
A TypeScript cast of untyped outside data to a specific type:JSON.parse(text) as T, (await response.json()) as T, response.json() as Promise<T> and req.body as T. The cast tells the compiler the shape is right without checking it, so a missing or wrongly typed field passes type checking and fails later, far from the boundary.
The finding is at the default level when the data comes straight from a request: req.body or ctx.request.body, await request.json() on a handler’s request parameter, or JSON.parse(event.body) in a Lambda handler. Parsed text, fetch responses and casts to a type parameter of the enclosing function are contextual.
It stays quiet when the same function validates something with a schema or guard: zod, valibot, yup, joi, superstruct or io-ts (parse, safeParse, validate, decode, is, assert), typia, ajv, TypeBox Check, class-validator and class-transformer (validate, validateOrReject, plainToInstance), or a named guard such as isOrder(value) or parseOrder(value). Casts that claim nothing beyond the parser’s own result (unknown, primitives, object, Record<string, unknown>, unknown[], fields typed unknown, Partial<T>, optionally with | null) and JSON.parse(JSON.stringify(value)) clones are also left alone. Test, generated and vendored files are skipped.
How to review
Validate the value with a schema at the boundary, such asOrderInput.parse(req.body) with zod, or narrow it with a type guard. Answer a request with a 400 when validation fails. Mark a trusted source with // loadwise-reviewed unchecked-json-cast -- <reason> on the line above.
Configuration
Set the rule to"off" in loadwise.config.json to drop its findings: