Repository: parcel-bundler/parcel
File: packages/transformers/js/core/src/lib.rs (Rust)

Code before:
                // Decorators can use type information, so must run before the TypeScript pass.
                Optional::new(
                  decorators::decorators(decorators::Config {
                    legacy: true,
                    // Always disabled for now, SWC's implementation doesn't match TSC.
                    emit_metadata: false,
                    // use_define_for_class_fields is ignored here, uses preset-env assumptions instead
                    ..Default::default()
                  }),
                  config.decorators
                ),
                Optional::new(
                  typescript::tsx(
                    source_map.clone(),
                    Default::default(),
                    typescript::TsxConfig {
                      pragma: react_options.pragma.clone(),
                      pragma_frag: react_options.pragma_frag.clone(),
                    },
                    Some(&comments),
                    unresolved_mark,
                  ),
                  config.is_type_script && config.is_jsx
                ),
                Optional::new(
                  typescript::strip(unresolved_mark),
                  config.is_type_script && !config.is_jsx
                ),
              ));

              // If it's a script, convert into module. This needs to happen after
              // the resolver (which behaves differently for non-/strict mode).
              let module = match module {
                Program::Module(module) => module,
                Program::Script(script) => Module {
                  span: script.span,
                  shebang: None,
                  body: script.body.into_iter().map(ModuleItem::Stmt).collect(),
                },
              };

              let module = module.fold_with(&mut Optional::new(
                react::react(
                  source_map.clone(),
                  Some(&comments),
                  react_options,
                  global_mark,
                  unresolved_mark,
                ),
                config.is_jsx,
              ));

Review comment (suggestion):
same here.

```suggestion
                  typescript::strip(global_mark),
```

Code after:
                // Decorators can use type information, so must run before the TypeScript pass.
                Optional::new(
                  decorators::decorators(decorators::Config {
                    legacy: true,
                    // Always disabled for now, SWC's implementation doesn't match TSC.
                    emit_metadata: false,
                    // use_define_for_class_fields is ignored here, uses preset-env assumptions instead
                    ..Default::default()
                  }),
                  config.decorators
                ),
                Optional::new(
                  typescript::tsx(
                    source_map.clone(),
                    Default::default(),
                    typescript::TsxConfig {
                      pragma: react_options.pragma.clone(),
                      pragma_frag: react_options.pragma_frag.clone(),
                    },
                    Some(&comments),
                    global_mark,
                  ),
                  config.is_type_script && config.is_jsx
                ),
                Optional::new(
                  typescript::strip(global_mark),
                  config.is_type_script && !config.is_jsx
                ),
              ));

              // If it's a script, convert into module. This needs to happen after
              // the resolver (which behaves differently for non-/strict mode).
              let module = match module {
                Program::Module(module) => module,
                Program::Script(script) => Module {
                  span: script.span,
                  shebang: None,
                  body: script.body.into_iter().map(ModuleItem::Stmt).collect(),
                },
              };

              let module = module.fold_with(&mut Optional::new(
                react::react(
                  source_map.clone(),
                  Some(&comments),
                  react_options,
                  global_mark,
                  unresolved_mark,
                ),
                config.is_jsx,
              ));