Parsing error on ANSI escape codes
bartosz-k opened this issue · comments
Bartosz Krupa commented
The following piece of code is valid but it is parsed incorrectly:
const highlight = (text: string) => `\x1b[1m${text}\x1b[0m`;
const dim = (text: string) => `\x1b[2m${text}\x1b[0m`;
const error = (text: string) => `\x1b[91m${text}\x1b[0m`;
Here's a link to the TypeScript Playground showing that the snippet above is valid JavaScript or TypeScript:
https://www.typescriptlang.org/play?#code/MYewdgzgLgBAFgSwOZwDbLrAvDAFFAUwA8oAuGaAJwTCQEoYsA+GAAwB0iBGAIwG0uAWwAkAb0IkAvp158ADINYBuAFChIsACYJBjPBLIUo1Wg2ZsZ-AEwjxxKNO78FyteGgwClSiEp789uRUNPSMLBxOfACcQmIGjrIuSkA