Add option to output .js files while preserving jsx

This commit adds the ability to preserve jsx in source code, but
also to output .js files rather than .jsx files. This is useful
for react-native which does not support .jsx files.
This commit is contained in:
David Sheldrick
2017-01-23 17:40:20 +01:00
parent 3cf326a8c4
commit dd0ed44b9a
9 changed files with 125 additions and 13 deletions

View File

@@ -417,7 +417,7 @@ namespace ts.server.protocol {
startOffset: number;
/**
* Position (can be specified instead of line/offset pair)
* Position (can be specified instead of line/offset pair)
*/
/* @internal */
startPosition?: number;
@@ -433,7 +433,7 @@ namespace ts.server.protocol {
endOffset: number;
/**
* Position (can be specified instead of line/offset pair)
* Position (can be specified instead of line/offset pair)
*/
/* @internal */
endPosition?: number;
@@ -445,7 +445,7 @@ namespace ts.server.protocol {
}
/**
* Response for GetCodeFixes request.
* Response for GetCodeFixes request.
*/
export interface GetCodeFixesResponse extends Response {
body?: CodeAction[];
@@ -2272,10 +2272,11 @@ namespace ts.server.protocol {
export namespace JsxEmit {
export type None = "None";
export type Preserve = "Preserve";
export type PreserveWithJsExtension = "PreserveWithJsExtension";
export type React = "React";
}
export type JsxEmit = JsxEmit.None | JsxEmit.Preserve | JsxEmit.React;
export type JsxEmit = JsxEmit.None | JsxEmit.Preserve | JsxEmit.React | JsxEmit.PreserveWithJsExtension;
export namespace ModuleKind {
export type None = "None";