-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tsfmt and JSX #4127
Comments
Another related example: /// <reference path="typings/tsd.d.ts" />
import React = require("react");
function test(): any {
let v: number = 5;
return <span>{ v }</span>;
} is formatted as:
|
This is a tsfmt bug. Here: https://github.com/vvakame/typescript-formatter/blob/master/lib/formatter.ts#L14 The source file the compiler gets is being created with the '.ts' extension, which means it's consumed using the regular TypeScript grammar. tsfmt needs to be able to support passing a '.tsx' file extension when appropriate so that expressions of the form |
@RyanCavanaugh - thanks very much. |
ah, I understand. thank you! |
I've been using
tsfmt
to format TypeScript code. I believe this uses the pretty-printer from core compiler service.But I've hit upon the following issue when formatting:
the output is:
Notice the problematic
< /span>
.The former compiles, the latter does not:
Any thoughts?
The text was updated successfully, but these errors were encountered: