rename preserveWithJsExtension to react-native

This commit is contained in:
David Sheldrick
2017-01-23 21:42:39 +01:00
parent 7879b22ea9
commit 8d590d5191
11 changed files with 24 additions and 24 deletions

4
lib/protocol.d.ts vendored
View File

@@ -1798,10 +1798,10 @@ declare namespace ts.server.protocol {
namespace JsxEmit {
type None = "None";
type Preserve = "Preserve";
type PreserveWithJsExtension = "PreserveWithJsExtension";
type ReactNative = "ReactNative";
type React = "React";
}
type JsxEmit = JsxEmit.None | JsxEmit.Preserve | JsxEmit.React | JsxEmit.PreserveWithJsExtension;
type JsxEmit = JsxEmit.None | JsxEmit.Preserve | JsxEmit.React | JsxEmit.ReactNative;
namespace ModuleKind {
type None = "None";
type CommonJS = "CommonJS";

View File

@@ -67,11 +67,11 @@ namespace ts {
name: "jsx",
type: createMapFromTemplate({
"preserve": JsxEmit.Preserve,
"preservewithjsextension": JsxEmit.PreserveWithJsExtension,
"react-native": JsxEmit.ReactNative,
"react": JsxEmit.React
}),
paramType: Diagnostics.KIND,
description: Diagnostics.Specify_JSX_code_generation_Colon_preserve_preserveWithJsExtension_or_react,
description: Diagnostics.Specify_JSX_code_generation_Colon_preserve_react_native_or_react,
},
{
name: "reactNamespace",

View File

@@ -2713,7 +2713,7 @@
"category": "Message",
"code": 6079
},
"Specify JSX code generation: 'preserve', 'preserveWithJsExtension', or 'react'": {
"Specify JSX code generation: 'preserve', 'react-native', or 'react'": {
"category": "Message",
"code": 6080
},

View File

@@ -3299,7 +3299,7 @@
None = 0,
Preserve = 1,
React = 2,
PreserveWithJsExtension = 3
ReactNative = 3
}
export const enum NewLineKind {

View File

@@ -87,7 +87,7 @@ namespace ts {
start: undefined,
length: undefined,
}, {
messageText: "Argument for '--jsx' option must be: 'preserve', 'preservewithjsextension', 'react'",
messageText: "Argument for '--jsx' option must be: 'preserve', 'react-native', 'react'",
category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category,
code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code,

View File

@@ -94,7 +94,7 @@ namespace ts {
file: undefined,
start: 0,
length: 0,
messageText: "Argument for '--jsx' option must be: 'preserve', 'preservewithjsextension', 'react'",
messageText: "Argument for '--jsx' option must be: 'preserve', 'react-native', 'react'",
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category
}]

View File

@@ -909,16 +909,16 @@ namespace ts {
const actual = ts.parseJsonConfigFileContent(json, caseInsensitiveMixedExtensionHost, caseInsensitiveBasePath);
assertParsed(actual, expected);
});
it("with jsx=preserveWithJsExtension, allowJs=false", () => {
it("with jsx=react-native, allowJs=false", () => {
const json = {
compilerOptions: {
jsx: "preserveWithJsExtension",
jsx: "react-native",
allowJs: false
}
};
const expected: ts.ParsedCommandLine = {
options: {
jsx: ts.JsxEmit.PreserveWithJsExtension,
jsx: ts.JsxEmit.ReactNative,
allowJs: false
},
errors: [],
@@ -986,16 +986,16 @@ namespace ts {
const actual = ts.parseJsonConfigFileContent(json, caseInsensitiveMixedExtensionHost, caseInsensitiveBasePath);
assertParsed(actual, expected);
});
it("with jsx=preserveWithJsExtension, allowJs=true", () => {
it("with jsx=react-native, allowJs=true", () => {
const json = {
compilerOptions: {
jsx: "preserveWithJsExtension",
jsx: "react-native",
allowJs: true
}
};
const expected: ts.ParsedCommandLine = {
options: {
jsx: ts.JsxEmit.PreserveWithJsExtension,
jsx: ts.JsxEmit.ReactNative,
allowJs: true
},
errors: [],

View File

@@ -2272,11 +2272,11 @@ namespace ts.server.protocol {
export namespace JsxEmit {
export type None = "None";
export type Preserve = "Preserve";
export type PreserveWithJsExtension = "PreserveWithJsExtension";
export type ReactNative = "ReactNative";
export type React = "React";
}
export type JsxEmit = JsxEmit.None | JsxEmit.Preserve | JsxEmit.React | JsxEmit.PreserveWithJsExtension;
export type JsxEmit = JsxEmit.None | JsxEmit.Preserve | JsxEmit.React | JsxEmit.ReactNative;
export namespace ModuleKind {
export type None = "None";

View File

@@ -1,9 +1,9 @@
/// <reference path="fourslash.ts" />
// @BaselineFile: getEmitOutputTsxFile_PreserveWithJsExtension.baseline
// @BaselineFile: getEmitOutputTsxFile_ReactNative.baseline
// @declaration: true
// @sourceMap: true
// @jsx: preserveWithJsExtension
// @jsx: react-native
// @Filename: inputFile1.ts
// @emitThisFile: true

View File

@@ -898,16 +898,16 @@ namespace ts {
assert.deepEqual(actual.wildcardDirectories, expected.wildcardDirectories);
assert.deepEqual(actual.errors, expected.errors);
});
it("with jsx=preserveWithJsExtension, allowJs=false", () => {
it("with jsx=react-native, allowJs=false", () => {
const json = {
compilerOptions: {
jsx: "preserveWithJsExtension",
jsx: "react-native",
allowJs: false
}
};
const expected: ts.ParsedCommandLine = {
options: {
jsx: ts.JsxEmit.PreserveWithJsExtension,
jsx: ts.JsxEmit.ReactNative,
allowJs: false
},
errors: [],
@@ -981,16 +981,16 @@ namespace ts {
assert.deepEqual(actual.wildcardDirectories, expected.wildcardDirectories);
assert.deepEqual(actual.errors, expected.errors);
});
it("with jsx=preserveWithJsExtension, allowJs=true", () => {
it("with jsx=react-native, allowJs=true", () => {
const json = {
compilerOptions: {
jsx: "preserveWithJsExtension",
jsx: "react-native",
allowJs: true
}
};
const expected: ts.ParsedCommandLine = {
options: {
jsx: ts.JsxEmit.PreserveWithJsExtension,
jsx: ts.JsxEmit.ReactNative,
allowJs: true
},
errors: [],