jest-codemods icon indicating copy to clipboard operation
jest-codemods copied to clipboard

Typescript: function (this) is incorrectly transformed

Open JavaScriptBach opened this issue 2 years ago • 1 comments

I ran the parser on Typescript and found that function (this) gets incorrectly transformed to this =>. The result was invalid syntax.

this is a special case and should not be transformed; see https://www.typescriptlang.org/docs/handbook/2/functions.html#declaring-this-in-a-function

JavaScriptBach avatar Apr 04 '24 18:04 JavaScriptBach

Thanks for reporting. Which transformer did you use?

Are you up for fixing the issue?

skovhus avatar Apr 04 '24 18:04 skovhus