Not really https://github.com/microsoft/TypeScript/issues/9235
Though with tuples, etc. being defined, maybe it's worth re-examining.
Though with tuples, etc. being defined, maybe it's worth re-examining.
I haven't tried it yet but it looks like the new optional element access feature is only checking if the array itself is defined, not if the array index is defined.
Otherwise, you're left to creating a wrapper function and a custom ESlint rule.
Edit: found it 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!