3 ms·
Are you saying typescript should parse regular expressions? Turn on `noUncheckedIndexAccess` and it works as you expect (plus forces you to check all the place
by c-hendricks 2y ago
Are you saying typescript should parse regular expressions?
Turn on `noUncheckedIndexAccess` and it works as you expect (plus forces you to check all the places you're doing unchecked access).
https://www.typescriptlang.org/play/?noUncheckedIndexedAccess=true#code/MYewdgzgLgBAtgQysAFjAvDARArA6RZFACgHpiEBKAfmICMbTKBuAKAEsAzGYw1GAITpMYAK4AbcZRgBvVjAUxQkWAG0ANDASa6AXQzwkqNoq3iApgCcoFPFBABVAA5OrAYQQRzxSi3mKEC2t6O0cXd09vXzYAXyA https://www.typescriptlang.org/play/?noUncheckedIndexedAcces...
- swift 2y agoRegular expressions are part of the language, so it's not so unreasonable that TypeScript should parse them and take their semantics into account. Indeed, TypeScript 5.5 will include new support for syntax checking of regular expressions[1], and presumably they'll eventually be able to solve the problem the GP highlighted on top of those foundations. [1]: https://github.com/microsoft/TypeScript/pull/55600 https://github.com/microsoft/TypeScript/pull/55600
- c-hendricks 2y agoThat's crazy, in the best way