Skip to content

Commit

Permalink
Add lint exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorhdzg committed Jun 27, 2024
1 parent 0b62171 commit 1c3f985
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/agent/diagnostics/etwDiagnosticLogger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export class EtwDiagnosticLogger extends BaseDiagnosticLogger {
}

public logMessage(diagnosticLog: IDiagnosticLog) {
let metaData = this._getMetadata();
const metaData = this._getMetadata();
metaData.push(diagnosticLog.messageId || "");
let message: string = diagnosticLog.message;
const message: string = diagnosticLog.message;
this._agentLogger.log(message, metaData);
}

Expand Down
5 changes: 4 additions & 1 deletion src/agent/diagnostics/writers/etwWritter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class EtwWritter implements IAgentLogger {
private _etwModule: typeof etwTypes | undefined;

constructor() {
let nodeMajVer = parseInt(process.versions.node.split('.')[0], 10);
const nodeMajVer = parseInt(process.versions.node.split('.')[0], 10);

try {
this._etwModule = this._loadEtwModule(nodeMajVer);
Expand All @@ -28,6 +28,7 @@ export class EtwWritter implements IAgentLogger {

public log(message?: any, ...optional: any[]) {
if(this._etwModule){
// eslint-disable-next-line @typescript-eslint/ban-types
(this._etwModule.logInfoEvent as Function)(message, ...optional);
}
else{
Expand All @@ -37,6 +38,7 @@ export class EtwWritter implements IAgentLogger {

public error(message?: any, ...optional: any[]) {
if(this._etwModule){
// eslint-disable-next-line @typescript-eslint/ban-types
(this._etwModule.logErrEvent as Function)(message, ...optional);
}
else{
Expand All @@ -50,6 +52,7 @@ export class EtwWritter implements IAgentLogger {
try {
// throws an error if directory is not readable / does not exist
fs.accessSync(dirname, fs.constants.R_OK);
// eslint-disable-next-line @typescript-eslint/no-var-requires
return require(dirname) as typeof etwTypes;
} catch (e) {
// Could not load ETW, return nothing
Expand Down

0 comments on commit 1c3f985

Please sign in to comment.