DEV Community

Discussion on: The dark side of Record in TypeScript

Collapse
 
lokhmakov profile image
Pavel Lokhmakov

What do you think about tsconfig 'noUncheckedIndexedAccess' in the case of Record?

Collapse
 
zuta profile image
Taras Zubyk πŸ‡ΊπŸ‡¦

Hi Pavel!

You bring up a good point. I wasn't aware of this fairly new flag in tsconfig.

noUncheckedIndexedAccess certainly seems like a possible solution to the problem explained in the post. It is however disabled by default and only available starting from TS v4.1.

I'll update the post to include the noUncheckedIndexedAccess bit.

Thank you!