@@ -11,20 +11,20 @@ interface GroupState {
11
11
}
12
12
13
13
export default {
14
- preprocess ( code : string ) {
14
+ preprocess ( code : string ) : string [ ] {
15
15
return [ code ]
16
16
} ,
17
17
18
- postprocess ( messages : LintMessage [ ] [ ] ) {
18
+ postprocess ( messages : LintMessage [ ] [ ] ) : LintMessage [ ] {
19
19
const state = {
20
20
block : {
21
21
disableAllKeys : new Set < string > ( ) ,
22
22
disableRuleKeys : new Map < string , string [ ] > ( )
23
- } as GroupState ,
23
+ } satisfies GroupState ,
24
24
line : {
25
25
disableAllKeys : new Set < string > ( ) ,
26
26
disableRuleKeys : new Map < string , string [ ] > ( )
27
- } as GroupState
27
+ } satisfies GroupState
28
28
}
29
29
const usedDisableDirectiveKeys : string [ ] = [ ]
30
30
const unusedDisableDirectiveReports = new Map < string , LintMessage > ( )
@@ -132,7 +132,7 @@ function addDisableRule(
132
132
disableRuleKeys : GroupState [ 'disableRuleKeys' ] ,
133
133
rule : string ,
134
134
key : string
135
- ) {
135
+ ) : void {
136
136
let keys = disableRuleKeys . get ( rule )
137
137
if ( keys ) {
138
138
keys . push ( key )
@@ -142,7 +142,7 @@ function addDisableRule(
142
142
}
143
143
}
144
144
145
- function messageToKey ( message : LintMessage ) {
145
+ function messageToKey ( message : LintMessage ) : string {
146
146
return `line:${ message . line } ,column${
147
147
// -1 because +1 by ESLint's `report-translator`.
148
148
message . column - 1
@@ -156,6 +156,6 @@ function messageToKey(message: LintMessage) {
156
156
* @returns A value less than 1 if itemA appears before itemB in the source file, greater than 1 if
157
157
* itemA appears after itemB in the source file, or 0 if itemA and itemB have the same location.
158
158
*/
159
- function compareLocations ( itemA : Position , itemB : Position ) {
159
+ function compareLocations ( itemA : Position , itemB : Position ) : number {
160
160
return itemA . line - itemB . line || itemA . column - itemB . column
161
161
}
0 commit comments