Skip to content

Commit

Permalink
Merge branch 'v2' into clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Sep 10, 2023
2 parents f6e669a + c98a4a0 commit 27e9a8f
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 60 deletions.
80 changes: 40 additions & 40 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/transformers/js/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2021"
crate-type = ["rlib"]

[dependencies]
swc_core = { version = "0.79.67", features = [
swc_core = { version = "0.83.4", features = [
"common",
"common_ahash",
"common_sourcemap",
Expand Down
20 changes: 8 additions & 12 deletions packages/transformers/js/core/src/hoist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ impl<'a> Fold for Hoist<'a> {
import.src.value.clone(),
ModuleItem::ModuleDecl(ModuleDecl::Import(ImportDecl {
specifiers: vec![],
asserts: None,
with: None,
span: DUMMY_SP,
src: Box::new(
format!("{}:{}:{}", self.module_id, import.src.value, "esm").into(),
Expand Down Expand Up @@ -196,7 +196,7 @@ impl<'a> Fold for Hoist<'a> {
src.value.clone(),
ModuleItem::ModuleDecl(ModuleDecl::Import(ImportDecl {
specifiers: vec![],
asserts: None,
with: None,
span: DUMMY_SP,
src: Box::new(Str {
value: format!("{}:{}:{}", self.module_id, src.value, "esm").into(),
Expand Down Expand Up @@ -291,7 +291,7 @@ impl<'a> Fold for Hoist<'a> {
export.src.value.clone(),
ModuleItem::ModuleDecl(ModuleDecl::Import(ImportDecl {
specifiers: vec![],
asserts: None,
with: None,
span: DUMMY_SP,
src: Box::new(
format!("{}:{}:{}", self.module_id, export.src.value, "esm").into(),
Expand Down Expand Up @@ -397,7 +397,7 @@ impl<'a> Fold for Hoist<'a> {
.module_items
.push(ModuleItem::ModuleDecl(ModuleDecl::Import(ImportDecl {
specifiers: vec![],
asserts: None,
with: None,
span: DUMMY_SP,
src: Box::new(Str {
value: format!("{}:{}", self.module_id, source).into(),
Expand Down Expand Up @@ -438,7 +438,7 @@ impl<'a> Fold for Hoist<'a> {
.module_items
.push(ModuleItem::ModuleDecl(ModuleDecl::Import(ImportDecl {
specifiers: vec![],
asserts: None,
with: None,
span: DUMMY_SP,
src: Box::new(Str {
value: format!("{}:{}", self.module_id, source,).into(),
Expand Down Expand Up @@ -998,7 +998,7 @@ impl<'a> Hoist<'a> {
.module_items
.push(ModuleItem::ModuleDecl(ModuleDecl::Import(ImportDecl {
specifiers: vec![],
asserts: None,
with: None,
span: DUMMY_SP,
src: Box::new(src.into()),
type_only: false,
Expand Down Expand Up @@ -1187,12 +1187,8 @@ mod tests {
&mut buf,
Some(&mut src_map_buf),
));
let config = swc_core::ecma::codegen::Config {
minify: false,
ascii_only: false,
target: swc_core::ecma::ast::EsVersion::Es5,
omit_last_semi: false,
};
let config =
swc_core::ecma::codegen::Config::default().with_target(swc_core::ecma::ast::EsVersion::Es5);
let mut emitter = swc_core::ecma::codegen::Emitter {
cfg: config,
comments: Some(&comments),
Expand Down
9 changes: 2 additions & 7 deletions packages/transformers/js/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use std::str::FromStr;
use indexmap::IndexMap;
use path_slash::PathExt;
use serde::{Deserialize, Serialize};
use swc_core;
use swc_core::common::comments::SingleThreadedComments;
use swc_core::common::errors::{DiagnosticBuilder, Emitter, Handler};
use swc_core::common::pass::Optional;
Expand Down Expand Up @@ -567,12 +566,8 @@ fn emit(
None
},
));
let config = swc_core::ecma::codegen::Config {
minify: false,
ascii_only: false,
target: swc_core::ecma::ast::EsVersion::Es5,
omit_last_semi: false,
};
let config =
swc_core::ecma::codegen::Config::default().with_target(swc_core::ecma::ast::EsVersion::Es5);
let mut emitter = swc_core::ecma::codegen::Emitter {
cfg: config,
comments: Some(&comments),
Expand Down

0 comments on commit 27e9a8f

Please sign in to comment.