summaryrefslogtreecommitdiff
path: root/cli/tsc/diagnostics.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tsc/diagnostics.rs')
-rw-r--r--cli/tsc/diagnostics.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/tsc/diagnostics.rs b/cli/tsc/diagnostics.rs
index 9525d1855..ac65973d8 100644
--- a/cli/tsc/diagnostics.rs
+++ b/cli/tsc/diagnostics.rs
@@ -280,6 +280,17 @@ impl Diagnostics {
Diagnostics(diagnostics)
}
+ pub fn emit_warnings(&mut self) {
+ self.0.retain(|d| {
+ if d.category == DiagnosticCategory::Warning {
+ log::warn!("{}\n", d);
+ false
+ } else {
+ true
+ }
+ });
+ }
+
/// Return a set of diagnostics where only the values where the predicate
/// returns `true` are included.
pub fn filter<P>(self, predicate: P) -> Self