TYPE013infoPro

unvalidated-json-parse

JSON.parse() result has properties accessed without type validation

Applies to: JavaScript, TypeScript

Why this matters

JSON.parse() returns `any` in TypeScript. Without runtime validation (Zod, type guard, etc.), property access on the result is unchecked. If the JSON doesn't contain the expected properties, you get silent undefined values that cause bugs downstream. Validate the shape before accessing properties.

Catch it before it ships

pip install stablestack # or: npx stablestackstablestack # scans your project, TYPE013 includedstablestack explain TYPE013

TYPE013 is part of the Pro rule set. See pricing — the free tier ships 24 checks with no signup.

False positive in your codebase? Suppress a single line with # noqa: TYPE013