aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/editor/DiagnosticValue.ts
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-11-25 15:28:56 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-12-09 00:07:38 +0100
commitcc27b2fbea058022f2f3fc3b3f74d91355d7e237 (patch)
tree7b81505b181c821f66aa629f7702b975bd9eb2b3 /subprojects/frontend/src/editor/DiagnosticValue.ts
parentchore(web): fix lint error (diff)
downloadrefinery-cc27b2fbea058022f2f3fc3b3f74d91355d7e237.tar.gz
refinery-cc27b2fbea058022f2f3fc3b3f74d91355d7e237.tar.zst
refinery-cc27b2fbea058022f2f3fc3b3f74d91355d7e237.zip
refactor(frontend): simplify diagnostic tracking
Diffstat (limited to 'subprojects/frontend/src/editor/DiagnosticValue.ts')
-rw-r--r--subprojects/frontend/src/editor/DiagnosticValue.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/subprojects/frontend/src/editor/DiagnosticValue.ts b/subprojects/frontend/src/editor/DiagnosticValue.ts
index ad23c467..b4e0b165 100644
--- a/subprojects/frontend/src/editor/DiagnosticValue.ts
+++ b/subprojects/frontend/src/editor/DiagnosticValue.ts
@@ -1,14 +1,16 @@
1import type { Diagnostic } from '@codemirror/lint'; 1import type { Diagnostic } from '@codemirror/lint';
2import { RangeValue } from '@codemirror/state'; 2import { RangeValue } from '@codemirror/state';
3 3
4export type Severity = Diagnostic['severity'];
5
4export default class DiagnosticValue extends RangeValue { 6export default class DiagnosticValue extends RangeValue {
5 static VALUES: Record<Diagnostic['severity'], DiagnosticValue> = { 7 static VALUES: Record<Severity, DiagnosticValue> = {
6 error: new DiagnosticValue('error'), 8 error: new DiagnosticValue('error'),
7 warning: new DiagnosticValue('warning'), 9 warning: new DiagnosticValue('warning'),
8 info: new DiagnosticValue('info'), 10 info: new DiagnosticValue('info'),
9 }; 11 };
10 12
11 private constructor(public readonly severity: Diagnostic['severity']) { 13 private constructor(public readonly severity: Severity) {
12 super(); 14 super();
13 } 15 }
14 16