Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
SoonIter committed Jan 6, 2025
1 parent 9ad0edf commit 8332673
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions crates/rspack_loader_swc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@ mod compiler;
mod options;
mod transformer;

use std::borrow::Cow;
use std::cell::RefCell;
use std::default::Default;
use std::str::FromStr;
use std::sync::Arc;

use compiler::{IntoJsAst, SwcCompiler};
use options::SwcCompilerOptionsWithAdditional;
pub use options::SwcLoaderJsOptions;
use rspack_cacheable::{cacheable, cacheable_dyn};
use rspack_core::{Mode, RunnerContext};
use rspack_error::miette::diagnostic;
use rspack_error::{error, AnyhowError, Diagnostic, Result};
use rspack_loader_runner::{Identifiable, Identifier, Loader, LoaderContext};
use rspack_paths::Utf8PathBuf;
Expand All @@ -26,7 +22,6 @@ use rspack_util::source_map::SourceMapKind;
use swc_config::{config_types::MergingOption, merge::Merge};
use swc_core::base::config::SourceMapsConfig;
use swc_core::base::config::{InputSourceMap, OutputCharset, TransformConfig};
use swc_core::common::comments::SingleThreadedComments;
use swc_core::ecma::codegen::to_code_with_comments;
use swc_core::ecma::visit::VisitWith;
use swc_typescript::fast_dts::FastDts;
Expand Down Expand Up @@ -174,19 +169,16 @@ impl SwcLoader {
let issues = checker.transform(&mut program);
let should_abort = *abort_on_error && !issues.is_empty();

dbg!(&issues);

let diagnostics: Vec<Diagnostic> = issues
.into_iter()
.map(|issue| {
let file = Utf8PathBuf::from(issue.range.filename.to_owned().as_ref().to_string());
// TODO: miss line number in issue.range
Diagnostic::warn(SWC_LOADER_IDENTIFIER.to_string(), issue.message.to_string())
})
.collect();

if should_abort {
let mut message: String = error!(
let message: String = error!(
"Failed to generate dts code in {}",
SWC_LOADER_IDENTIFIER.to_string(),
)
Expand Down

0 comments on commit 8332673

Please sign in to comment.