@@ -11,20 +11,20 @@ interface GroupState {
1111}
1212
1313export default {
14- preprocess ( code : string ) {
14+ preprocess ( code : string ) : string [ ] {
1515 return [ code ]
1616 } ,
1717
18- postprocess ( messages : LintMessage [ ] [ ] ) {
18+ postprocess ( messages : LintMessage [ ] [ ] ) : LintMessage [ ] {
1919 const state = {
2020 block : {
2121 disableAllKeys : new Set < string > ( ) ,
2222 disableRuleKeys : new Map < string , string [ ] > ( )
23- } as GroupState ,
23+ } satisfies GroupState ,
2424 line : {
2525 disableAllKeys : new Set < string > ( ) ,
2626 disableRuleKeys : new Map < string , string [ ] > ( )
27- } as GroupState
27+ } satisfies GroupState
2828 }
2929 const usedDisableDirectiveKeys : string [ ] = [ ]
3030 const unusedDisableDirectiveReports = new Map < string , LintMessage > ( )
@@ -132,7 +132,7 @@ function addDisableRule(
132132 disableRuleKeys : GroupState [ 'disableRuleKeys' ] ,
133133 rule : string ,
134134 key : string
135- ) {
135+ ) : void {
136136 let keys = disableRuleKeys . get ( rule )
137137 if ( keys ) {
138138 keys . push ( key )
@@ -142,7 +142,7 @@ function addDisableRule(
142142 }
143143}
144144
145- function messageToKey ( message : LintMessage ) {
145+ function messageToKey ( message : LintMessage ) : string {
146146 return `line:${ message . line } ,column${
147147 // -1 because +1 by ESLint's `report-translator`.
148148 message . column - 1
@@ -156,6 +156,6 @@ function messageToKey(message: LintMessage) {
156156 * @returns A value less than 1 if itemA appears before itemB in the source file, greater than 1 if
157157 * itemA appears after itemB in the source file, or 0 if itemA and itemB have the same location.
158158 */
159- function compareLocations ( itemA : Position , itemB : Position ) {
159+ function compareLocations ( itemA : Position , itemB : Position ) : number {
160160 return itemA . line - itemB . line || itemA . column - itemB . column
161161}
0 commit comments