skovhus / jest-codemods

Codemods for migrating to Jest https://github.com/facebook/jest 👾
MIT License
877 stars 81 forks source link

Typescript: function (this) is incorrectly transformed #563

Open JavaScriptBach opened 4 months ago

JavaScriptBach commented 4 months ago

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

skovhus commented 4 months ago

Thanks for reporting. Which transformer did you use?

Are you up for fixing the issue?