File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -41,13 +41,16 @@ export const consoleLogger: SkLogger = {
4141 */
4242export function createFileLogger ( filePath : string ) : SkLogger {
4343 // Lazy import fs to avoid bundling issues
44- let fs : any = null ;
44+
45+ type FsModule = typeof import ( 'fs' ) ;
46+ let fs : FsModule | null = null ;
4547
4648 const writeLog = ( level : string , message : string , ...args : unknown [ ] ) => {
4749 if ( ! fs ) {
4850 try {
49- fs = require ( 'fs' ) ;
50- } catch ( e ) {
51+ // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
52+ fs = require ( 'fs' ) as FsModule ;
53+ } catch {
5154 // File logging not available in this context
5255 return ;
5356 }
@@ -59,7 +62,7 @@ export function createFileLogger(filePath: string): SkLogger {
5962
6063 try {
6164 fs . appendFileSync ( filePath , logLine , 'utf8' ) ;
62- } catch ( e ) {
65+ } catch {
6366 // Silently fail if we can't write to the file
6467 }
6568 } ;
You can’t perform that action at this time.
0 commit comments