File tree 2 files changed +3
-24
lines changed
packages/components/src/modifiers
2 files changed +3
-24
lines changed Original file line number Diff line number Diff line change @@ -34,11 +34,6 @@ type HdsCodeEditorBlurHandler = (
34
34
event : FocusEvent
35
35
) => void ;
36
36
37
- export type HdsCodeEditorLintDiagnostic = Pick <
38
- DiagnosticType ,
39
- 'from' | 'to' | 'message' | 'severity'
40
- > ;
41
-
42
37
export interface HdsCodeEditorSignature {
43
38
Args : {
44
39
Named : {
@@ -51,7 +46,7 @@ export interface HdsCodeEditorSignature {
51
46
value ?: string ;
52
47
onInput ?: ( newVal : string ) => void ;
53
48
onBlur ?: HdsCodeEditorBlurHandler ;
54
- onLint ?: ( diagnostics : HdsCodeEditorLintDiagnostic [ ] ) => void ;
49
+ onLint ?: ( diagnostics : DiagnosticType [ ] ) => void ;
55
50
onSetup ?: ( editor : EditorViewType ) => unknown ;
56
51
} ;
57
52
} ;
Original file line number Diff line number Diff line change 1
1
import RSVP from 'rsvp' ;
2
2
3
3
import type { Diagnostic as DiagnosticType } from '@codemirror/lint' ;
4
- import type {
5
- HdsCodeEditorLintDiagnostic ,
6
- HdsCodeEditorSignature ,
7
- } from '../../hds-code-editor' ;
4
+ import type { HdsCodeEditorSignature } from '../../hds-code-editor' ;
8
5
import type { Extension , Text } from '@codemirror/state' ;
9
6
10
7
export enum HdsCodeEditorJsonLintingError {
@@ -16,17 +13,6 @@ export enum HdsCodeEditorJsonLintingError {
16
13
ValueExpected = 'Value expected' ,
17
14
}
18
15
19
- export function parseDiagnostics (
20
- diagnostics : DiagnosticType [ ]
21
- ) : HdsCodeEditorLintDiagnostic [ ] {
22
- return diagnostics . map ( ( diagnostic ) => ( {
23
- from : diagnostic . from ,
24
- to : diagnostic . to ,
25
- message : diagnostic . message ,
26
- severity : diagnostic . severity ,
27
- } ) ) ;
28
- }
29
-
30
16
export function findNextToken (
31
17
doc : Text ,
32
18
index : number ,
@@ -147,9 +133,7 @@ export default async function jsonLinter(
147
133
}
148
134
} ) ;
149
135
150
- if ( onLint ) {
151
- onLint ( parseDiagnostics ( diagnostics ) ) ;
152
- }
136
+ onLint ?.( diagnostics ) ;
153
137
154
138
return diagnostics ;
155
139
} ) ;
You can’t perform that action at this time.
0 commit comments