4 ms·
I can't seem the find the GitHub issue for it off hand, but I believe you can override the default indexing signature for arrays to return possibly undefined.
by emptysea 7y ago
I can't seem the find the GitHub issue for it off hand, but I believe you can override the default indexing signature for arrays to return possibly undefined.
Otherwise, you're left to creating a wrapper function and a custom ESlint rule.
Edit: found it https://github.com/microsoft/TypeScript/issues/13778#issuecomment-277029664 https://github.com/microsoft/TypeScript/issues/13778#issueco...
The suggestion is to maintain your own copy of `index.d.ts` with the array indexing interface modified. Yikes!