The type check you turned off is still finding bugs
Two settings, each added for a good short-term reason, left part of a codebase unchecked. Turning them back on surfaced a bug that had already reached real data.
A project of ours had two settings that were individually understandable and jointly dangerous: builds were told to ignore type errors, and part of the codebase was excluded from type checking entirely. Between them, a meaningful chunk of the code was unchecked, and nothing about it looked unchecked.
What was hiding
Turning both back on surfaced errors immediately. The instructive one involved a library that returns `false` — not null, not undefined — when a value is absent.
The code guarded it with the nullish coalescing operator, which only replaces null and undefined. `false` passed straight through and was stored, where it became the string "false". Not an error, not a crash: a plausible-looking value sitting in a column, already written to real records.
Why it stayed hidden
Because both settings were added for good reasons at the time. One kept an editor quiet during a migration; the other kept a release moving. Neither was revisited, and neither announces itself — code outside a type check looks exactly like code that passes one.
The checker had the information the whole time. It had been told not to look.
What we changed
- Type errors fail the build. If that blocks a release, the error is the problem, not the check.
- Nothing is excluded from type checking without a written reason beside it — and no reason has survived being written down.
- Prefer `||` to `??` when a falsy value is as wrong as a missing one. They are not interchangeable; they answer different questions.
Taking code out of type checking makes its bugs invisible, not absent.