mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
feat(napi/transform)!: rename TransformOptions::react to jsx. (#6211)
This commit is contained in:
parent
cca0034e8b
commit
afc3ccbece
3 changed files with 4 additions and 4 deletions
2
napi/transform/index.d.ts
vendored
2
napi/transform/index.d.ts
vendored
|
|
@ -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
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ pub struct TransformOptions {
|
|||
pub typescript: Option<TypeScriptOptions>,
|
||||
|
||||
/// Configure how TSX and JSX are transformed.
|
||||
pub react: Option<JsxOptions>,
|
||||
pub jsx: Option<JsxOptions>,
|
||||
|
||||
/// Enable ES2015 transformations.
|
||||
pub es2015: Option<ES2015BindingOptions>,
|
||||
|
|
@ -45,7 +45,7 @@ impl From<TransformOptions> 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()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ test(
|
|||
return <button onClick={() => setCount(count + 1)}>count is {count}</button>;
|
||||
};
|
||||
`,
|
||||
{ react: { refresh: {} } },
|
||||
{ jsx: { refresh: {} } },
|
||||
),
|
||||
{
|
||||
code: 'var _s = $RefreshSig$();\n' +
|
||||
|
|
|
|||
Loading…
Reference in a new issue