Skip to content

Commit

Permalink
Refactor for changes in swc_core
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jul 2, 2024
1 parent 017503e commit 3d2e4d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/swc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use swc_core::common::{
use swc_core::ecma::ast::{EsVersion, Expr, Module, PropOrSpread};
use swc_core::ecma::codegen::{text_writer::JsWriter, Emitter};
use swc_core::ecma::parser::{
error::Error as SwcError, parse_file_as_expr, parse_file_as_module, EsConfig, Syntax,
error::Error as SwcError, parse_file_as_expr, parse_file_as_module, EsSyntax, Syntax,
};
use swc_core::ecma::visit::VisitMutWith;

Expand Down Expand Up @@ -361,9 +361,9 @@ fn create_config(source: String) -> (SourceFile, Syntax, EsVersion) {
BytePos::from_usize(1),
),
// Syntax.
Syntax::Es(EsConfig {
Syntax::Es(EsSyntax {
jsx: true,
..EsConfig::default()
..EsSyntax::default()
}),
// Version.
EsVersion::Es2022,
Expand Down
6 changes: 3 additions & 3 deletions src/swc_util_build_jsx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ mod tests {
EsVersion, ExprStmt, JSXClosingElement, JSXElementName, JSXOpeningElement, JSXSpreadChild,
Module, Stmt,
};
use swc_core::ecma::parser::{parse_file_as_module, EsConfig, Syntax};
use swc_core::ecma::parser::{parse_file_as_module, EsSyntax, Syntax};

fn compile(value: &str, options: &Options) -> Result<String, markdown::message::Message> {
let location = Location::new(value.as_bytes());
Expand All @@ -821,9 +821,9 @@ mod tests {
value.into(),
BytePos::from_usize(1),
),
Syntax::Es(EsConfig {
Syntax::Es(EsSyntax {
jsx: true,
..EsConfig::default()
..EsSyntax::default()
}),
EsVersion::Es2022,
Some(&comments),
Expand Down

0 comments on commit 3d2e4d1

Please sign in to comment.