Skip to content

Commit 5b0dfd9

Browse files
committed
Deemphasize old JSX transform
People should choose the new, automatic transform over the old transform which required a React import.
1 parent 069de74 commit 5b0dfd9

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

src/compiler/commandLineParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ const compileOnSaveCommandLineOption: CommandLineOption = {
133133
const jsxOptionMap = new Map(Object.entries({
134134
"preserve": JsxEmit.Preserve,
135135
"react-native": JsxEmit.ReactNative,
136-
"react": JsxEmit.React,
137136
"react-jsx": JsxEmit.ReactJSX,
138137
"react-jsxdev": JsxEmit.ReactJSXDev,
138+
"react": JsxEmit.React,
139139
}));
140140

141141
/** @internal */

tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse empty options of --jsx.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ FileNames::
77
0.ts
88
Errors::
99
error TS6044: Compiler option 'jsx' expects an argument.
10-
error TS6046: Argument for '--jsx' option must be: 'preserve', 'react-native', 'react', 'react-jsx', 'react-jsxdev'.
10+
error TS6046: Argument for '--jsx' option must be: 'preserve', 'react-native', 'react-jsx', 'react-jsxdev', 'react'.
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Fs::
2-
//// [/apath/a.ts]
3-
4-
5-
//// [/apath/b.js]
6-
7-
8-
//// [/apath/tsconfig.json]
2+
//// [/apath/a.ts]
3+
4+
5+
//// [/apath/b.js]
6+
7+
8+
//// [/apath/tsconfig.json]
99
{
1010
"compilerOptions": {
1111
"module": "commonjs",
@@ -14,8 +14,8 @@ Fs::
1414
"sourceMap": false,
1515
"jsx": ""
1616
}
17-
}
18-
17+
}
18+
1919

2020
configFileName:: tsconfig.json
2121
CompilerOptions::
@@ -27,5 +27,5 @@ CompilerOptions::
2727
"configFilePath": "/apath/tsconfig.json"
2828
}
2929
Errors::
30-
[91merror[0m[90m TS6046: [0mArgument for '--jsx' option must be: 'preserve', 'react-native', 'react', 'react-jsx', 'react-jsxdev'.
30+
[91merror[0m[90m TS6046: [0mArgument for '--jsx' option must be: 'preserve', 'react-native', 'react-jsx', 'react-jsxdev', 'react'.
3131

Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Fs::
2-
//// [/apath/a.ts]
3-
4-
5-
//// [/apath/b.js]
6-
7-
8-
//// [/apath/tsconfig.json]
2+
//// [/apath/a.ts]
3+
4+
5+
//// [/apath/b.js]
6+
7+
8+
//// [/apath/tsconfig.json]
99
{
1010
"compilerOptions": {
1111
"module": "commonjs",
@@ -14,8 +14,8 @@ Fs::
1414
"sourceMap": false,
1515
"jsx": ""
1616
}
17-
}
18-
17+
}
18+
1919

2020
configFileName:: tsconfig.json
2121
CompilerOptions::
@@ -27,8 +27,8 @@ CompilerOptions::
2727
"configFilePath": "/apath/tsconfig.json"
2828
}
2929
Errors::
30-
[96mtsconfig.json[0m:[93m7[0m:[93m12[0m - [91merror[0m[90m TS6046: [0mArgument for '--jsx' option must be: 'preserve', 'react-native', 'react', 'react-jsx', 'react-jsxdev'.
31-
32-
7 "jsx": ""
33-
   ~~
30+
[96mtsconfig.json[0m:[93m7[0m:[93m12[0m - [91merror[0m[90m TS6046: [0mArgument for '--jsx' option must be: 'preserve', 'react-native', 'react-jsx', 'react-jsxdev', 'react'.
31+
32+
7 "jsx": ""
33+
   ~~
3434

0 commit comments

Comments
 (0)