Why this matters
Catches misconfiguration early and standardizes configuration contracts.
At process start, validate required configuration keys and fail fast with a clear message if any are missing or malformed.
Catches misconfiguration early and standardizes configuration contracts.
Side-by-side examples engineers can pattern-match during review.
const apiKey = process.env.API_KEY; // may be undefinedconst REQUIRED = ['API_KEY','API_URL']; for (const k of REQUIRED) if(!process.env[k]) throw new Error(`Missing ${k}`);process.env.API_KEY // uncheckedif(!process.env.API_KEY) throw new Error('Missing API_KEY')From the same buckets as this rule.