Skip to content

Commit

Permalink
feat(napi/transform)!: rename TransformOptions::react to jsx.
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Oct 1, 2024
1 parent c3c3447 commit d80b138
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion napi/transform/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
/**
Expand Down
4 changes: 2 additions & 2 deletions napi/transform/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand All @@ -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()
}
Expand Down

0 comments on commit d80b138

Please sign in to comment.