mirror of
https://github.com/danbulant/oxc
synced 2026-05-25 04:42:10 +00:00
fix(transformer): react development default value should be false (#3002)
This commit is contained in:
parent
5f4c1e1d3e
commit
67045467c7
2 changed files with 9 additions and 17 deletions
|
|
@ -67,8 +67,7 @@ pub struct ReactOptions {
|
|||
|
||||
/// This toggles behavior specific to development, such as adding __source and __self.
|
||||
///
|
||||
/// Defaults to `true`.
|
||||
#[serde(default = "default_as_true")]
|
||||
/// Defaults to `false`.
|
||||
pub development: bool,
|
||||
|
||||
/// Toggles whether or not to throw an error if a XML namespaced tag name is used.
|
||||
|
|
@ -127,10 +126,10 @@ impl Default for ReactOptions {
|
|||
Self {
|
||||
jsx_plugin: true,
|
||||
display_name_plugin: true,
|
||||
jsx_self_plugin: true,
|
||||
jsx_source_plugin: true,
|
||||
jsx_self_plugin: false,
|
||||
jsx_source_plugin: false,
|
||||
runtime: ReactJsxRuntime::default(),
|
||||
development: default_as_true(),
|
||||
development: false,
|
||||
throw_if_namespace: default_as_true(),
|
||||
pure: default_as_true(),
|
||||
import_source: default_for_import_source(),
|
||||
|
|
@ -144,11 +143,11 @@ impl Default for ReactOptions {
|
|||
|
||||
impl ReactOptions {
|
||||
pub fn is_jsx_self_plugin_enabled(&self) -> bool {
|
||||
self.jsx_self_plugin && self.development
|
||||
self.jsx_self_plugin || self.development
|
||||
}
|
||||
|
||||
pub fn is_jsx_source_plugin_enabled(&self) -> bool {
|
||||
self.jsx_source_plugin && self.development
|
||||
self.jsx_source_plugin || self.development
|
||||
}
|
||||
|
||||
/// Scan through all comments and find the following pragmas
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
Passed: 126/219
|
||||
Passed: 133/219
|
||||
|
||||
# All Passed:
|
||||
* babel-plugin-transform-react-jsx-source
|
||||
|
||||
|
||||
# babel-preset-typescript (4/16)
|
||||
* jsx-compat/js-valid/input.js
|
||||
# babel-preset-typescript (6/16)
|
||||
* jsx-compat/ts-invalid/input.ts
|
||||
* jsx-compat/tsx-valid/input.tsx
|
||||
* node-extensions/import-in-cts/input.cts
|
||||
* node-extensions/type-assertion-in-cts/input.cts
|
||||
* node-extensions/type-assertion-in-mts/input.mts
|
||||
|
|
@ -87,16 +85,11 @@ Passed: 126/219
|
|||
* regression/15768/input.ts
|
||||
* variable-declaration/non-null-in-optional-chain/input.ts
|
||||
|
||||
# babel-preset-react (2/11)
|
||||
# babel-preset-react (7/11)
|
||||
* preset-options/development/input.js
|
||||
* preset-options/development-runtime-automatic/input.js
|
||||
* preset-options/development-runtime-automatic-windows/input.js
|
||||
* preset-options/development-windows/input.js
|
||||
* preset-options/empty-options/input.js
|
||||
* preset-options/runtime-automatic/input.js
|
||||
* preset-options/runtime-classic/input.js
|
||||
* preset-options/runtime-classic-pragma-no-frag/input.js
|
||||
* regression/11294/input.mjs
|
||||
|
||||
# babel-plugin-transform-react-jsx (35/36)
|
||||
* autoImport/complicated-scope-module/input.js
|
||||
|
|
|
|||
Loading…
Reference in a new issue