You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to add this to one of our projects, I noticed the library changing the behavior of several of our classes that format strings. Digging into the output code, it appears that tspath is adding a semicolon immediately after return when returning a string template, so, return ` would become return;` . I created a test case to replicate the behavior.
Source:
class TestClass {
public getString(): string {
const content = `
Do something
`;
this._notUsed(content);
return this._getString(content);
}
private _notUsed(value: string): string {
return `
${value}
`;
}
private _getString(value: string): string {
return `
This ${value} is on the next line
`;
}
}
console.log(new TestClass().getString());
Expected:
This
Do something
is on the next line
Returned: undefined
The text was updated successfully, but these errors were encountered:
When trying to add this to one of our projects, I noticed the library changing the behavior of several of our classes that format strings. Digging into the output code, it appears that tspath is adding a semicolon immediately after return when returning a string template, so,
return `
would becomereturn;`
. I created a test case to replicate the behavior.Source:
Expected:
Returned:
undefined
The text was updated successfully, but these errors were encountered: