diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-09-14 11:58:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-14 11:58:47 +0100 |
commit | af2d992ecd2b9320072164b6ee295c31a3194406 (patch) | |
tree | 0926e2852aa2c4eb300e1f54f4c84d7568589b3b /cli/tsc/diagnostics.rs | |
parent | 2c0bf6fd65b3276c4818c73028b19819608c8e70 (diff) |
feat: TypeScript 5.6 and `npm:@types/node@22` (#25614)
Diffstat (limited to 'cli/tsc/diagnostics.rs')
-rw-r--r-- | cli/tsc/diagnostics.rs | 11 |
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 |