@@ -24,13 +24,13 @@ export interface ControlledTypeScriptSystem extends ts.System {
2424 path : string ,
2525 callback : ts . FileWatcherCallback ,
2626 pollingInterval ?: number ,
27- options ?: ts . WatchOptions
27+ options ?: ts . WatchOptions ,
2828 ) : ts . FileWatcher ;
2929 watchDirectory (
3030 path : string ,
3131 callback : ts . DirectoryWatcherCallback ,
3232 recursive ?: boolean ,
33- options ?: ts . WatchOptions
33+ options ?: ts . WatchOptions ,
3434 ) : ts . FileWatcher ;
3535 getModifiedTime ( path : string | undefined ) : Date | undefined ;
3636 setModifiedTime ( path : string , time : Date ) : void ;
@@ -109,7 +109,7 @@ export const system: ControlledTypeScriptSystem = {
109109 . filter (
110110 ( dirent ) =>
111111 dirent . isDirectory ( ) ||
112- ( dirent . isSymbolicLink ( ) && system . directoryExists ( join ( path , dirent . name ) ) )
112+ ( dirent . isSymbolicLink ( ) && system . directoryExists ( join ( path , dirent . name ) ) ) ,
113113 )
114114 . map ( ( dirent ) => dirent . name ) ;
115115 } ,
@@ -135,12 +135,12 @@ export const system: ControlledTypeScriptSystem = {
135135 watchDirectory (
136136 path : string ,
137137 callback : ts . DirectoryWatcherCallback ,
138- recursive = false
138+ recursive = false ,
139139 ) : ts . FileWatcher {
140140 return createWatcher (
141141 recursive ? recursiveDirectoryWatcherCallbacksMap : directoryWatcherCallbacksMap ,
142142 path ,
143- callback
143+ callback ,
144144 ) ;
145145 } ,
146146 // use immediate instead of timeout to avoid waiting 250ms for batching files changes
@@ -206,7 +206,7 @@ export const system: ControlledTypeScriptSystem = {
206206function createWatcher < TCallback > (
207207 watchersMap : Map < string , TCallback [ ] > ,
208208 path : string ,
209- callback : TCallback
209+ callback : TCallback ,
210210) {
211211 const normalizedPath = normalizeAndResolvePath ( path ) ;
212212 const watchers = watchersMap . get ( normalizedPath ) || [ ] ;
@@ -230,17 +230,17 @@ function createWatcher<TCallback>(
230230function invokeFileWatchers ( path : string , event : ts . FileWatcherEventKind ) {
231231 const normalizedPath = normalizeAndResolvePath ( path ) ;
232232 if ( normalizedPath . endsWith ( '.js' ) ) {
233- // trigger relevant .d.ts file watcher - handles the case, when we have webpack watcher
233+ // trigger relevant .d.ts file watcher - handles the case, when we have Rspack watcher
234234 // that points to a symlinked package
235235 invokeFileWatchers ( normalizedPath . slice ( 0 , - 3 ) + '.d.ts' , event ) ;
236236 }
237237
238238 const fileWatcherCallbacks = fileWatcherCallbacksMap . get ( normalizedPath ) ;
239239 if ( fileWatcherCallbacks ) {
240240 // typescript expects normalized paths with posix forward slash
241- fileWatcherCallbacks . forEach ( ( fileWatcherCallback ) =>
242- fileWatcherCallback ( forwardSlash ( normalizedPath ) , event )
243- ) ;
241+ fileWatcherCallbacks . forEach ( ( fileWatcherCallback ) => {
242+ fileWatcherCallback ( forwardSlash ( normalizedPath ) , event ) ;
243+ } ) ;
244244 }
245245}
246246
@@ -254,9 +254,9 @@ function invokeDirectoryWatchers(path: string) {
254254
255255 const directoryWatcherCallbacks = directoryWatcherCallbacksMap . get ( directory ) ;
256256 if ( directoryWatcherCallbacks ) {
257- directoryWatcherCallbacks . forEach ( ( directoryWatcherCallback ) =>
258- directoryWatcherCallback ( forwardSlash ( normalizedPath ) )
259- ) ;
257+ directoryWatcherCallbacks . forEach ( ( directoryWatcherCallback ) => {
258+ directoryWatcherCallback ( forwardSlash ( normalizedPath ) ) ;
259+ } ) ;
260260 }
261261
262262 recursiveDirectoryWatcherCallbacksMap . forEach (
@@ -266,11 +266,11 @@ function invokeDirectoryWatchers(path: string) {
266266 ( directory . startsWith ( watchedDirectory ) &&
267267 forwardSlash ( directory ) [ watchedDirectory . length ] === '/' )
268268 ) {
269- recursiveDirectoryWatcherCallbacks . forEach ( ( recursiveDirectoryWatcherCallback ) =>
270- recursiveDirectoryWatcherCallback ( forwardSlash ( normalizedPath ) )
271- ) ;
269+ recursiveDirectoryWatcherCallbacks . forEach ( ( recursiveDirectoryWatcherCallback ) => {
270+ recursiveDirectoryWatcherCallback ( forwardSlash ( normalizedPath ) ) ;
271+ } ) ;
272272 }
273- }
273+ } ,
274274 ) ;
275275}
276276
0 commit comments