Improve transform-react-jsx typings (#13820)

* improve transform-react-jsx typings

* rename test fixtures

* remove unreachable sourceSelf check

* update test fixtures

* Update packages/babel-core/src/index.ts

* Update packages/babel-plugin-transform-react-jsx/src/create-plugin.ts

Co-authored-by: Henry Zhu <hi@henryzoo.com>

* Update packages/babel-plugin-transform-react-jsx/src/create-plugin.ts

Co-authored-by: Henry Zhu <hi@henryzoo.com>
This commit is contained in:
Huáng Jùnliàng
2021-10-07 14:01:50 -04:00
committed by GitHub
parent 41325645f8
commit c2f747c9b9
7 changed files with 136 additions and 60 deletions

View File

@@ -0,0 +1 @@
var x = <div __self={self}></div>;

View File

@@ -0,0 +1,4 @@
{
"throws": "Duplicate __self prop found. You are most likely using the deprecated transform-react-jsx-self Babel plugin. Both __source and __self are automatically set when using the automatic runtime. Please remove transform-react-jsx-source and transform-react-jsx-self from your Babel config.",
"plugins": ["transform-react-jsx-development"]
}

View File

@@ -0,0 +1 @@
var x = <div __source={source}></div>;

View File

@@ -0,0 +1,4 @@
{
"throws": "Duplicate __source prop found. You are most likely using the deprecated transform-react-jsx-source Babel plugin. Both __source and __self are automatically set when using the automatic runtime. Please remove transform-react-jsx-source and transform-react-jsx-self from your Babel config.",
"plugins": ["transform-react-jsx-development"]
}