Skip to content

Commit d4bcdf2

Browse files
committed
tslint
1 parent 9a58d6c commit d4bcdf2

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/LoggerHelper.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
export class LoggerHelper {
1919
public static cwdArray: string[] = process.cwd().split(pathSeparator);
2020

21+
// eslint-disable-next-line @rushstack/no-new-null
2122
public static cleanUpFilePath(fileName: string | null): string | null {
2223
return fileName == null
2324
? fileName
@@ -222,6 +223,7 @@ export class LoggerHelper {
222223
public static _getCodeFrame(
223224
filePath: string,
224225
lineNumber: number,
226+
// eslint-disable-next-line @rushstack/no-new-null
225227
columnNumber: number | null,
226228
linesBeforeAndAfter: number
227229
): ICodeFrame | undefined {

src/LoggerWithoutCallSite.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ export class LoggerWithoutCallSite {
4343
private _mySettings: ISettingsParam = {};
4444
private _childLogger: Logger[] = [];
4545
private _maskAnyRegExp: RegExp | undefined;
46-
protected _callSiteWrapper: (callSite: NodeJS.CallSite) => NodeJS.CallSite = (
47-
callSite: NodeJS.CallSite
48-
) => callSite;
4946

5047
/**
5148
* @param settings - Configuration of the logger instance (all settings are optional with sane defaults)
@@ -175,7 +172,8 @@ export class LoggerWithoutCallSite {
175172

176173
this._maskAnyRegExp =
177174
this.settings.maskAnyRegEx?.length > 0
178-
? new RegExp(Object.values(this.settings.maskAnyRegEx).join("|"), "g")
175+
? // eslint-disable-next-line @rushstack/security/no-unsafe-regexp
176+
new RegExp(Object.values(this.settings.maskAnyRegEx).join("|"), "g")
179177
: undefined;
180178

181179
LoggerHelper.setUtilsInspectStyles(
@@ -202,10 +200,7 @@ export class LoggerWithoutCallSite {
202200
const childSettings: ISettings = {
203201
...this.settings,
204202
};
205-
const childLogger: Logger = new (this.constructor as any)(
206-
settings,
207-
childSettings
208-
);
203+
const childLogger: Logger = new Logger(settings, childSettings);
209204
this._childLogger.push(childLogger);
210205
return childLogger;
211206
}
@@ -313,6 +308,10 @@ export class LoggerWithoutCallSite {
313308
return errorObject;
314309
}
315310

311+
protected _callSiteWrapper: (callSite: NodeJS.CallSite) => NodeJS.CallSite = (
312+
callSite: NodeJS.CallSite
313+
) => callSite;
314+
316315
private _handleLog(
317316
logLevel: TLogLevelName,
318317
logArguments: unknown[],

0 commit comments

Comments
 (0)