Use new JSX transform (#56294)

Co-authored-by: Jimmy Lai <laijimmy0@gmail.com>
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
This commit is contained in:
Sebastian Silbermann 2023-12-09 00:17:50 +01:00 committed by GitHub
parent 4dd8c0bb04
commit 79a8d01ae6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 9 additions and 18 deletions

View file

@ -113,14 +113,6 @@
"jsdoc/no-undefined-types": "error"
}
},
{
"files": [
"test/**/*",
"examples/**/*",
"packages/create-next-app/templates/**/*"
],
"rules": { "react/react-in-jsx-scope": "off" }
},
{
"files": ["examples/**/*"],
"rules": {
@ -351,7 +343,7 @@
"react/no-direct-mutation-state": "warn",
"react/no-is-mounted": "warn",
"react/no-typos": "error",
"react/react-in-jsx-scope": "error",
"react/react-in-jsx-scope": "off",
"react/require-render-return": "error",
"react/style-prop-object": "warn",
"react-hooks/rules-of-hooks": "error",

View file

@ -10,7 +10,7 @@
"target": "es2017",
"noUnusedLocals": true,
"noUnusedParameters": true,
"jsx": "react",
"jsx": "react-jsx",
"jsxFactory": "h"
},
"include": ["src", "types/jsx.d.ts"],

View file

@ -484,7 +484,7 @@ export async function getPageStaticInfo(params: {
const fileContent = (await tryToReadFile(pageFilePath, !isDev)) || ''
if (
/runtime|preferredRegion|getStaticProps|getServerSideProps|generateStaticParams|export const/.test(
/(?<!(_jsx|jsx-))runtime|preferredRegion|getStaticProps|getServerSideProps|generateStaticParams|export const/.test(
fileContent
)
) {

View file

@ -111,7 +111,6 @@ function getBaseSWCOptions({
? '@emotion/react'
: 'react'),
runtime: 'automatic',
pragma: 'React.createElement',
pragmaFrag: 'React.Fragment',
throwIfNamespace: true,
development: !!development,

View file

@ -56,7 +56,7 @@ module.exports = function (task) {
},
transform: {
react: {
pragma: 'React.createElement',
runtime: 'automatic',
pragmaFrag: 'React.Fragment',
throwIfNamespace: true,
development: false,
@ -102,7 +102,7 @@ module.exports = function (task) {
},
transform: {
react: {
pragma: 'React.createElement',
runtime: 'automatic',
pragmaFrag: 'React.Fragment',
throwIfNamespace: true,
development: false,

View file

@ -6,7 +6,7 @@
"target": "ES2017",
"esModuleInterop": true,
"moduleResolution": "node",
"jsx": "react",
"jsx": "react-jsx",
"stripInternal": true,
"verbatimModuleSyntax": true
},

View file

@ -9,7 +9,7 @@
"downlevelIteration": true,
"preserveWatchOutput": true,
"outDir": "dist",
"jsx": "react",
"jsx": "react-jsx",
"noFallthroughCasesInSwitch": true,
"skipLibCheck": true,
"module": "Node16",

View file

@ -4,7 +4,7 @@
"esModuleInterop": true,
"target": "es2019",
"outDir": "dist",
"jsx": "react",
"jsx": "react-jsx",
"resolveJsonModule": true,
"module": "commonjs",
"rootDir": "src"

View file

@ -4,7 +4,7 @@
"noEmit": true,
"allowJs": true,
"resolveJsonModule": true,
"jsx": "react",
"jsx": "react-jsx",
"module": "esnext",
"target": "ESNext",
"esModuleInterop": true,