File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,16 +75,19 @@ function resolveDiagnosticsChannel(): DiagnosticsChannelModule | undefined {
7575 let dc : DiagnosticsChannelModule | undefined ;
7676 try {
7777 if (
78- typeof process !== 'undefined' &&
79- typeof ( process as { getBuiltinModule ?: ( id : string ) => unknown } )
80- . getBuiltinModule === 'function'
81- ) {
82- dc = (
83- process as {
84- getBuiltinModule : ( id : string ) => DiagnosticsChannelModule ;
78+ // eslint-disable-next-line n/no-unsupported-features/node-builtins
79+ typeof (
80+ globalThis as {
81+ process ?: { getBuiltinModule ?: ( id : string ) => unknown } ;
8582 }
86- ) . getBuiltinModule ( 'node:diagnostics_channel' ) ;
83+ ) ?. process ?. getBuiltinModule === 'function'
84+ ) {
85+ // eslint-disable-next-line n/no-unsupported-features/node-builtins
86+ dc = globalThis . process . getBuiltinModule (
87+ 'node:diagnostics_channel' ,
88+ ) as DiagnosticsChannelModule ;
8789 }
90+ // TODO: remove this code when we drop support for Node < 20.16>.
8891 /* c8 ignore next 6 */
8992 if ( ! dc && typeof require === 'function' ) {
9093 // CJS fallback for runtimes that lack `process.getBuiltinModule`
You can’t perform that action at this time.
0 commit comments