diff --git a/crates/oxc_transformer/src/react_jsx/mod.rs b/crates/oxc_transformer/src/react_jsx/mod.rs index 782f1ec27..eb3d84326 100644 --- a/crates/oxc_transformer/src/react_jsx/mod.rs +++ b/crates/oxc_transformer/src/react_jsx/mod.rs @@ -95,7 +95,7 @@ impl<'a> ReactJsx<'a> { let imports = self.ast.move_statement_vec(&mut self.imports); let index = stmts .iter() - .position(|stmt| matches!(stmt, Statement::ModuleDeclaration(m) if m.is_import())) + .rposition(|stmt| matches!(stmt, Statement::ModuleDeclaration(m) if m.is_import())) .map_or(0, |i| i + 1); stmts.splice(index..index, imports); } diff --git a/tasks/transform_conformance/babel.snap.md b/tasks/transform_conformance/babel.snap.md index c48245221..dfc10125c 100644 --- a/tasks/transform_conformance/babel.snap.md +++ b/tasks/transform_conformance/babel.snap.md @@ -1,4 +1,4 @@ -Passed: 224/1083 +Passed: 226/1083 # All Passed: * babel-plugin-transform-numeric-separator @@ -804,9 +804,7 @@ Passed: 224/1083 * regression/11061/input.mjs * variable-declaration/non-null-in-optional-chain/input.ts -# babel-plugin-transform-react-jsx (75/172) -* autoImport/after-polyfills/input.mjs -* autoImport/after-polyfills-2/input.mjs +# babel-plugin-transform-react-jsx (77/172) * autoImport/after-polyfills-compiled-to-cjs/input.mjs * autoImport/after-polyfills-script-not-supported/input.js * autoImport/auto-import-react-source-type-module/input.js