TYPE009warningPro

env-non-null-assertion

Non-null assertion on env vars can cause runtime crashes

Applies to: JavaScript, TypeScript

Why this matters

Using process.env.VARIABLE! assumes the environment variable is always defined, but this is often not true in development, CI, or new deployments. If the variable is missing, you'll get undefined behavior instead of a clear error. Validate environment variables at startup with a schema validator like Zod or t3-env.

Catch it before it ships

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

TYPE009 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: TYPE009