Fix errors, move no diagnostics provided message
MODIFY
packages/@romejs/cli-diagnostics/DiagnosticsPrinter.ts
packages/@romejs/cli-diagnostics/DiagnosticsPrinter.ts
@@ -367,15 +367,7 @@ export default class DiagnosticsPrinter extends Error {
}
print() {
- let filteredDiagnostics = this.filterDiagnostics();
-
- if (filteredDiagnostics.length === 0) {
- this.reporter.error(
- 'No diagnostics provided. They have likely all been filtered but this operation does not support suppressions. Showing complete diagnostics instead.',
- );
- filteredDiagnostics = this.processor.getCompleteUnfilteredDiagnostics();
- }
-
+ const filteredDiagnostics = this.filterDiagnostics();
this.fetchFileSources(filteredDiagnostics);
this.displayDiagnostics(filteredDiagnostics);
}
@@ -520,6 +512,16 @@ export default class DiagnosticsPrinter extends Error {
filterDiagnostics(): Diagnostics {
const diagnostics = this.getDiagnostics();
+
+ if (diagnostics.length === 0) {
+ this.reporter.error(
+ 'No diagnostics provided. They have likely all been filtered, but this operation does not check for suppressions. Showing complete diagnostics instead.',
+ );
+ return this.processor.getCompleteUnfilteredDiagnostics(
+ this.reporter.markupOptions,
+ );
+ }
+
const filteredDiagnostics: Diagnostics = [];
for (const diag of diagnostics) {

MODIFY
packages/@romejs/diagnostics/DiagnosticsProcessor.ts
packages/@romejs/diagnostics/DiagnosticsProcessor.ts
@@ -241,7 +241,9 @@ export default class DiagnosticsProcessor {
return [...this.unfilteredDiagnostics];
}
- getCompleteUnfilteredDiagnostics(): Diagnostics {
+ getCompleteUnfilteredDiagnostics(
+ markupOptions: MarkupFormatOptions = {},
+ ): Diagnostics {
return normalizeDiagnostics(this.unfilteredDiagnostics, markupOptions);
}

Fix errors, move no diagnostics provided message