DEV Community

Cover image for You Probably Know This Bug, but why does it Always Slip Through?

You Probably Know This Bug, but why does it Always Slip Through?

Lukas Mauser on November 14, 2023

TypeScript does not catch this in strict mode Does this error look familiar? Trying to access undefined objects is one of the most fr...
Collapse
 
code42cate profile image
Jonas Scholz

I honestly hate not having all of the strict compilerOptions on. I usually have at least those in every config:

{
    "strict": true,
    "allowUnusedLabels": false,
    "allowUnreachableCode": false,
    "exactOptionalPropertyTypes": true,
    "noFallthroughCasesInSwitch": true,
    "noImplicitOverride": true,
    "noImplicitReturns": true,
    "noPropertyAccessFromIndexSignature": true,
    "noUncheckedIndexedAccess": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
}
Enter fullscreen mode Exit fullscreen mode