Question presented to candidate:
"Most projects set strict: true in tsconfig. What does that one flag actually turn on, and what kinds of bugs does each part catch?"
What a strong answer should cover:
strictis an umbrella for the strict family; each member can be overridden individually- The members in 5.4:
noImplicitAny,strictNullChecks,strictFunctionTypes,strictBindCallApply,strictPropertyInitialization,noImplicitThis,alwaysStrict,useUnknownInCatchVariables, plusstrictBuiltinIteratorReturnadded in 5.6 - Why
strictNullChecksandnoImplicitAnymatter most, with a concrete crash each one prevents - Details: method-syntax parameters stay bivariant,
strictPropertyInitializationneedsstrictNullChecks, catch variables becomeunknown - What is not included (
noUncheckedIndexedAccess,exactOptionalPropertyTypes) and how to roll strict out on an existing codebase
Code / implementation expected: Optional β one or two snippets that compile without strict and fail with it.