Open eric-schneider opened 3 months ago
We use highlight.js for syntax highlighting. My guess is that this is an issue with the language definition itself (included in the core library): https://github.com/highlightjs/highlight.js/blob/main/src/languages/typescript.js
The highlight.js project maintains the core language definitions, so we should probably follow up by filing an issue. Alternatively, we can try and find a 3rd party TS definition and test whether it has the same highlighting issue.
Reported by @toptobes:
Syntax highlighting breaks when you have an immediately-invoked function expression (IIFE) that's an arrow function:
Works fine with old-school function expressions:
All I can say is that when making an IIFE using an arrow function, it renders the body of it improperly (as shown in the first image), But for some reason, renders properly when you declare an interface before it (so I'd imagine it might work if you declare a class or type before it? Haven't tested it yet though.)