mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
3c14d0523c
When `noUncheckedIndexedAccess` is not enabled, indexed accesses do not include `undefined` in the type. This makes the OptionalChainNotNullableCheck inconvenient when wanting to safe guard an indexed access (and when the typings isn't helping you). Ideally project should enable `noUncheckedIndexedAccess` for better typesafety, but this is often inconveninent (we do not enable it by default) and often not the resort of the developer. So more better coding convinience, `OptionalChainNotNullableCheck` will not raise an error/warning on indexed Acessed followed by an optional chaining when `noUncheckedIndexedAccess` is not enabled. See also #63809 which will detect more cases PR Close #64007