The comment between let and Foo is problematic for our use of tsickle and Closure Compiler. But I think the issue is more general. I'd expect the comment to appear only once in the output.
We validated that the same fix (calling setSyntheticLeadingComments(expression, undefined)) after setOriginalNodehere and here would fix this. Are you open to such a fix? If so, I'd be happy to send a PR.
π Expected behavior
/*from transformer*/ let Foo = class Foo {
};
Foo = __decorate([
decorate()
], Foo);
Bug Report
π Search Terms
setSyntheticLeadingComments, transformer
π Version & Regression Information
In 5.0 TypeScript already emitted the comment twice. In 5.1 it emits it 3 times.
(+1 on both if you count the comment on the __decorate call)
π» Code
Repro: https://github.com/frigus02/test-ts-triple-synthesized-comment
π Actual behavior
The comment between
let
andFoo
is problematic for our use of tsickle and Closure Compiler. But I think the issue is more general. I'd expect the comment to appear only once in the output.This seems very similar to https://github.com/microsoft/TypeScript/issues/45696
We validated that the same fix (calling
setSyntheticLeadingComments(expression, undefined)
) aftersetOriginalNode
here and here would fix this. Are you open to such a fix? If so, I'd be happy to send a PR.π Expected behavior