diff --git a/napi/transform/index.d.ts b/napi/transform/index.d.ts index 6df4cae4d7c137..ff0f123a657cfd 100644 --- a/napi/transform/index.d.ts +++ b/napi/transform/index.d.ts @@ -190,7 +190,7 @@ export interface TransformOptions { /** Configure how TypeScript is transformed. */ typescript?: TypeScriptOptions /** Configure how TSX and JSX are transformed. */ - react?: JsxOptions + jsx?: JsxOptions /** Enable ES2015 transformations. */ es2015?: ES2015BindingOptions /** diff --git a/napi/transform/src/options.rs b/napi/transform/src/options.rs index 8cd3de7be69677..cf577fe044deda 100644 --- a/napi/transform/src/options.rs +++ b/napi/transform/src/options.rs @@ -25,7 +25,7 @@ pub struct TransformOptions { pub typescript: Option, /// Configure how TSX and JSX are transformed. - pub react: Option, + pub jsx: Option, /// Enable ES2015 transformations. pub es2015: Option, @@ -45,7 +45,7 @@ impl From for oxc_transformer::TransformOptions { Self { cwd: options.cwd.map(PathBuf::from).unwrap_or_default(), typescript: options.typescript.map(Into::into).unwrap_or_default(), - react: options.react.map(Into::into).unwrap_or_default(), + react: options.jsx.map(Into::into).unwrap_or_default(), es2015: options.es2015.map(Into::into).unwrap_or_default(), ..Self::default() } diff --git a/napi/transform/test.mjs b/napi/transform/test.mjs index b6d48812ab4e94..37d443f325ccbb 100644 --- a/napi/transform/test.mjs +++ b/napi/transform/test.mjs @@ -62,7 +62,7 @@ test( return ; }; `, - { react: { refresh: {} } }, + { jsx: { refresh: {} } }, ), { code: 'var _s = $RefreshSig$();\n' +