@@ -64,17 +64,16 @@ export const overrideSettings = (newOverrides: Partial<Configuration>) => {
6464export const fourslashLikeTester = ( contents : string , fileName = entrypoint ) => {
6565 const [ positive , _negative , numberedPositions ] = fileContentsSpecialPositions ( contents , fileName )
6666
67- const ranges = positive . reduce (
67+ const ranges = positive . reduce < number [ ] [ ] > (
6868 ( prevRanges , pos ) => {
6969 const lastPrev = prevRanges [ prevRanges . length - 1 ] !
7070 if ( lastPrev . length < 2 ) {
7171 lastPrev . push ( pos )
7272 return prevRanges
73- } else {
74- return [ ...prevRanges , [ pos ] ]
7573 }
74+ return [ ...prevRanges , [ pos ] ]
7675 } ,
77- [ [ ] ] as number [ ] [ ] ,
76+ [ [ ] ] ,
7877 )
7978 return {
8079 completion : ( marker : number | number [ ] , matcher : CompletionMatcher , meta ?) => {
@@ -127,7 +126,7 @@ export const fourslashLikeTester = (contents: string, fileName = entrypoint) =>
127126 ) !
128127 const action = actionsGroup . actions . find ( action => action . description === refactorName ) !
129128 const { edits } = languageService . getEditsForRefactor ( fileName , { } , { pos : start , end } , actionsGroup . name , action . name , { } ) !
130- const a = tsFull . textChanges . applyChanges ( getCurrentFile ( ) , edits ! [ 0 ] ! . textChanges )
129+ const a = tsFull . textChanges . applyChanges ( getCurrentFile ( ) , edits [ 0 ] ! . textChanges )
131130 } else {
132131 expect ( appliableNames , `at marker ${ mark } ` ) . not . toContain ( refactorName )
133132 }
@@ -150,7 +149,7 @@ export const fileContentsSpecialPositions = (contents: string, fileName = entryp
150149 let mainMatch = currentMatch [ 1 ] !
151150 if ( addOnly ) mainMatch = mainMatch . slice ( 0 , - 1 )
152151 const possiblyNum = + mainMatch
153- if ( ! isNaN ( possiblyNum ) ) {
152+ if ( ! Number . isNaN ( possiblyNum ) ) {
154153 addArr [ 2 ] [ possiblyNum ] = offset
155154 } else {
156155 addArr [ mainMatch === 't' ? '0' : '1' ] . push ( offset )
0 commit comments