Skip to content
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

New JSX Transform opt out #9861

Merged
merged 5 commits into from
Oct 23, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix flag naming
  • Loading branch information
iansu committed Oct 23, 2020
commit b70cb5dfef257033ed00f1ed98966d565f9d5ac7
6 changes: 3 additions & 3 deletions packages/babel-preset-react-app/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

const path = require('path');

const useJsxRuntime = process.env.DISABLE_NEW_JSX_TRANSFORM !== 'true';
const useJsxTransform = process.env.DISABLE_NEW_JSX_TRANSFORM !== 'true';

const validateBoolOption = (name, value, defaultValue) => {
if (typeof value === 'undefined') {
Expand Down Expand Up @@ -97,8 +97,8 @@ module.exports = function (api, opts, env) {
development: isEnvDevelopment || isEnvTest,
// Will use the native built-in instead of trying to polyfill
// behavior for any plugins that require one.
...(!useJsxRuntime ? { useBuiltIns: true } : {}),
runtime: useJsxRuntime ? 'automatic' : 'classic',
...(!useJsxTransform ? { useBuiltIns: true } : {}),
runtime: useJsxTransform ? 'automatic' : 'classic',
},
],
isTypeScriptEnabled && [require('@babel/preset-typescript').default],
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-react-app/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// React App support, and is used as the `baseConfig` for `eslint-loader`
// to ensure that user-provided configs don't need this boilerplate.

const useJsxRuntime = process.env.DISABLE_NEW_JSX_RUNTIME !== 'true';
const useJsxTransform = process.env.DISABLE_NEW_JSX_TRANSFORM !== 'true';

module.exports = {
root: true,
Expand Down Expand Up @@ -45,7 +45,7 @@ module.exports = {
rules: {
'react/jsx-uses-vars': 'warn',
'react/jsx-uses-react': 'warn',
...(!useJsxRuntime && {
...(!useJsxTransform && {
'react/react-in-jsx-scope': 'error',
}),
},
Expand Down