Closed narumincho closed 2 weeks ago
Hello, thanks for the suggestion.
However, unfortunately I'm not willing to make this change given that noUncheckedIndexedAccess
already covers this.
Approaching this problem from type definition side is imperfect. Also I don't like the idea of suggesting our users to turn off noUncheckedIndexedAccess
.
Thanks for your reply. When I tried to change node_modules/@typescript/lib-es5/index.d.ts
directly, an error occurred, so it seems that this specification cannot be realized in the first place.
Instead of rewriting the type definitions provided by TypeScript, I will implement it by creating and using another type definition. (https://github.com/narumincho/readonly)
compilerOptions.noUncheckedIndexedAccess: false (default)
compilerOptions.noUncheckedIndexedAccess: true
I propose the following changes
With this change, both types are expected if noUncheckedIndexedAccess is false