unsafe-json-parse
JSON parsing with type assertion lacks runtime validation
Applies to: Go, Python, Ruby, Rust, TypeScript
Why this matters
Type assertions only affect compile-time checking. At runtime, JSON parsing returns unvalidated data, and if it doesn't match your expected type, you'll get confusing errors when you try to use missing properties. Use zod/pydantic for runtime validation.
Catch it before it ships
pip install stablestack # or: npx stablestackstablestack # scans your project, TYPE010 includedstablestack explain TYPE010TYPE010 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: TYPE010
More Type Safety checks
weak-typing
Weak typing pattern (Dict[str, Any], List[Any]) loses type safety.
TYPE002naked-dict-for-structured-data
Using plain dict for structured data instead of dataclass/TypedDict.
TYPE004missing-type-hints
Function is missing type hints.
TYPE005inline-type-definition
Inline type definition instead of using shared/generated types.
TYPE006dict-type-inconsistency
Dict return type annotation doesn't match actual value types being assigned.
TYPE007duplicate-type-definition
Type definition may be duplicated across files.
TYPE008typescript-any
Explicit 'any' type defeats TypeScript's type safety
TYPE009env-non-null-assertion
Non-null assertion on env vars can cause runtime crashes