#4315·ctags

TypeScript does not recognize functions defined via lambda

Author: jaflCreated Oct 13, 2025Updated Mar 5, 2026

The JavaScript parser recognizes this as a function:

const escape = s => s.replaceAll('<', '&lt;').replaceAll('>', '&gt;');

However, the TypeScript parser flags it as a constant. While technically correct, the JavaScript output is better, in my opinion.

Is there a reason the TypeScript parser wasn't simply an extension of the JavaScript parser?

Related: #4316