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:
parent
4dd8c0bb04
commit
79a8d01ae6
9 changed files with 9 additions and 18 deletions
|
@ -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",
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
"target": "es2017",
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"jsx": "react",
|
||||
"jsx": "react-jsx",
|
||||
"jsxFactory": "h"
|
||||
},
|
||||
"include": ["src", "types/jsx.d.ts"],
|
||||
|
|
|
@ -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
|
||||
)
|
||||
) {
|
||||
|
|
|
@ -111,7 +111,6 @@ function getBaseSWCOptions({
|
|||
? '@emotion/react'
|
||||
: 'react'),
|
||||
runtime: 'automatic',
|
||||
pragma: 'React.createElement',
|
||||
pragmaFrag: 'React.Fragment',
|
||||
throwIfNamespace: true,
|
||||
development: !!development,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"target": "ES2017",
|
||||
"esModuleInterop": true,
|
||||
"moduleResolution": "node",
|
||||
"jsx": "react",
|
||||
"jsx": "react-jsx",
|
||||
"stripInternal": true,
|
||||
"verbatimModuleSyntax": true
|
||||
},
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
"downlevelIteration": true,
|
||||
"preserveWatchOutput": true,
|
||||
"outDir": "dist",
|
||||
"jsx": "react",
|
||||
"jsx": "react-jsx",
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"skipLibCheck": true,
|
||||
"module": "Node16",
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"esModuleInterop": true,
|
||||
"target": "es2019",
|
||||
"outDir": "dist",
|
||||
"jsx": "react",
|
||||
"jsx": "react-jsx",
|
||||
"resolveJsonModule": true,
|
||||
"module": "commonjs",
|
||||
"rootDir": "src"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"noEmit": true,
|
||||
"allowJs": true,
|
||||
"resolveJsonModule": true,
|
||||
"jsx": "react",
|
||||
"jsx": "react-jsx",
|
||||
"module": "esnext",
|
||||
"target": "ESNext",
|
||||
"esModuleInterop": true,
|
||||
|
|
Loading…
Reference in a new issue