mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
fix(transformer/react-jsx): missing default options when plugin without config (#1219)
This commit is contained in:
parent
8afb81aa34
commit
a0f40cb058
2 changed files with 15 additions and 4 deletions
|
|
@ -3,7 +3,7 @@ use std::borrow::Cow;
|
|||
use oxc_semantic::Semantic;
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Default, Clone, Deserialize)]
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ReactJsxOptions {
|
||||
/// Decides which runtime to use.
|
||||
|
|
@ -38,6 +38,18 @@ fn default_pragma_frag() -> Cow<'static, str> {
|
|||
Cow::Borrowed("React.Fragment")
|
||||
}
|
||||
|
||||
impl Default for ReactJsxOptions {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
runtime: ReactJsxRuntime::Classic,
|
||||
throw_if_namespace: None,
|
||||
import_source: default_import_source(),
|
||||
pragma: default_pragma(),
|
||||
pragma_frag: default_pragma_frag(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone, Copy, Deserialize)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum ReactJsxRuntime {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
Passed: 265/1113
|
||||
Passed: 266/1113
|
||||
|
||||
# All Passed:
|
||||
* babel-plugin-transform-numeric-separator
|
||||
|
|
@ -852,7 +852,7 @@ Passed: 265/1113
|
|||
* regression/11061/input.mjs
|
||||
* variable-declaration/non-null-in-optional-chain/input.ts
|
||||
|
||||
# babel-plugin-transform-react-jsx (130/170)
|
||||
# babel-plugin-transform-react-jsx (131/170)
|
||||
* autoImport/after-polyfills-compiled-to-cjs/input.mjs
|
||||
* autoImport/complicated-scope-module/input.js
|
||||
* react/adds-appropriate-newlines-when-using-spread-attribute-babel-7/input.js
|
||||
|
|
@ -889,7 +889,6 @@ Passed: 265/1113
|
|||
* removed-options/invalid-use-spread-false/input.js
|
||||
* removed-options/invalid-use-spread-true/input.js
|
||||
* runtime/defaults-to-automatic/input.js
|
||||
* runtime/defaults-to-classis-babel-7/input.js
|
||||
* runtime/invalid-runtime/input.js
|
||||
* spread-transform/transform-to-babel-extend/input.js
|
||||
* spread-transform/transform-to-object-assign/input.js
|
||||
|
|
|
|||
Loading…
Reference in a new issue