Skip to content

Commit

Permalink
Fix ignored minimal severity flag (#686)
Browse files Browse the repository at this point in the history
* Fix ignored minimal severity setting

* Change default severity level to mach previous settings

* Create popular-shirts-fix.md
  • Loading branch information
Igloczek authored Nov 13, 2023
1 parent 9022997 commit 015a667
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/popular-shirts-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@astrojs/language-server": patch
---

Fix ignored minimal severity flag
4 changes: 2 additions & 2 deletions packages/language-server/src/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ export class AstroCheck {
// Filter diagnostics based on the logErrors level
const fileDiagnosticsToPrint = fileDiagnostics.filter((diag) => {
const severity = diag.severity ?? DiagnosticSeverity.Error;
switch (logErrors?.level ?? 'error') {
switch (logErrors?.level ?? 'hint') {
case 'error':
return true;
return severity <= DiagnosticSeverity.Error;
case 'warning':
return severity <= DiagnosticSeverity.Warning;
case 'hint':
Expand Down

0 comments on commit 015a667

Please sign in to comment.