Skip to content

Commit

Permalink
Fixed some issues
Browse files Browse the repository at this point in the history
  • Loading branch information
markwpearce committed Jun 28, 2024
1 parent 647d89d commit 75798ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/DiagnosticSeverityAdjuster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export class DiagnosticSeverityAdjuster {
if (map.has(code)) {
diagnostic.severity = map.get(code);
}
const name = String(diagnostic.name);
if (name && map.has(name)) {
diagnostic.severity = map.get(name);
const legacyCode = String(diagnostic.legacyCode);
if (legacyCode && map.has(legacyCode)) {
diagnostic.severity = map.get(legacyCode);
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/diagnosticUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function printDiagnostic(
let severityText = severityTextMap[severity];

console.log('');
const printableDiagnosticCode = (diagnostic as BsDiagnostic).name ? (diagnostic as BsDiagnostic).name : 'BS' + diagnostic.code;
const printableDiagnosticCode = diagnostic.code ? diagnostic.code.toString() : 'BS' + ((diagnostic as BsDiagnostic).legacyCode ?? '');

console.log(
chalk.cyan(filePath ?? '<unknown file>') +
Expand Down

0 comments on commit 75798ac

Please sign in to comment.