ESLint Can't Prevent "CI Passed, Prod Failed" — Here's the Missing Layer
ESLint is excellent at enforcing code style, catching syntax errors, and preventing common bugs. But it cannot prevent "CI passed, prod failed" scenarios because it doesn't validate runtime reality.
What ESLint catches
- Syntax errors and typos
- Code style inconsistencies
- Unused variables and imports
- Common bugs and anti-patterns
- Security best practices
What ESLint misses
- Mock clients in production builds
- Missing env vars triggering fallbacks
- Endpoint mismatches between frontend/backend
- Placeholder handlers in deployed routes
- Auth checks missing at runtime
The gap
ESLint validates code correctness. "CI passed, prod failed" is a runtime wiring issue. Code can be perfectly linted, type-safe, and styled correctly—but still fail in production because it's wired to fake services.
The solution: Add a reality gate
Complement ESLint with a deploy gate that validates:
- Frontend-backend endpoint mapping
- Auth coverage across routes
- Mock/stub import detection
- Required environment variables
Practical example
# ESLint (existing) eslint src/ # Add reality gate (new) npx guardrail mockproof npx guardrail gateResult
ESLint ensures code quality. The reality gate ensures runtime wiring. Together they prevent both bad code and broken deployments.
Some teams use guardrail to detect this automatically in CI.