Skip to content

Commit 9a3da2b

Browse files
committed
Alternative fix for linter errors.
1 parent 0e2ddc6 commit 9a3da2b

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Extension/src/common-remote-safe.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ import { basename, delimiter, dirname, isAbsolute, normalize, resolve } from 'no
1111
import { isMainThread } from 'node:worker_threads';
1212

1313
import { isWindows } from './constants';
14-
import { localize as localizationLocalize } from './localization';
15-
import * as logger from './logger';
16-
import { getOutputChannelLogger, note as loggerNote } from './logger';
1714
import { ManualPromise } from './Utility/Async/manualPromise';
1815
import { RemoteConnection } from './Utility/Remoting/snare';
1916
import { is } from './Utility/System/guards';
@@ -30,10 +27,14 @@ import { is } from './Utility/System/guards';
3027
let remoteConnection: RemoteConnection | undefined;
3128

3229
// In the main thread, grab the logger and localize functions directly.
33-
const logFn = isMainThread ? logger.log : () => { };
34-
const noteFn = isMainThread ? loggerNote : () => { };
35-
const localizeFn = isMainThread ? localizationLocalize : (info: { key: string; comment: string[] } | string, message: string, ...args: (string | number | boolean | undefined | null)[]) => message.replace(/\{(\d+)\}/g, (_, index) => String(args[Number(index)] ?? 'undefined'));
36-
const getOutputChannelLoggerFn = isMainThread ? getOutputChannelLogger : () => undefined;
30+
// eslint-disable-next-line @typescript-eslint/no-var-requires
31+
const logFn = isMainThread ? require('./logger').log : () => { };
32+
// eslint-disable-next-line @typescript-eslint/no-var-requires
33+
const noteFn = isMainThread ? require('./logger').note : () => { };
34+
// eslint-disable-next-line @typescript-eslint/no-var-requires
35+
const localizeFn = isMainThread ? require('./localization').localize : (info: { key: string; comment: string[] } | string, message: string, ...args: (string | number | boolean | undefined | null)[]) => message.replace(/\{(\d+)\}/g, (_, index) => String(args[Number(index)] ?? 'undefined'));
36+
// eslint-disable-next-line @typescript-eslint/no-var-requires
37+
const getOutputChannelLoggerFn = isMainThread ? require('./logger').getOutputChannelLogger : () => undefined;
3738

3839
/**
3940
* Used when this is imported in a module running in a worker thread.

0 commit comments

Comments
 (0)