Skip to content

Commit

Permalink
Fix eslint issues in botbuilder-applicationInsights (microsoft#4804)
Browse files Browse the repository at this point in the history
  • Loading branch information
ceciliaavila authored Dec 9, 2024
1 parent 64a10b1 commit 89ada0e
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 32 deletions.
10 changes: 0 additions & 10 deletions libraries/botbuilder-applicationinsights/eslint.config.cjs

This file was deleted.

5 changes: 2 additions & 3 deletions libraries/botbuilder-applicationinsights/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,15 @@
"dependencies": {
"applicationinsights": "^2.9.6",
"botbuilder-core": "4.1.6",
"cls-hooked": "^4.2.2",
"eslint-plugin-only-warn": "^1.1.0"
"cls-hooked": "^4.2.2"
},
"scripts": {
"build": "tsc -b",
"build-docs": "typedoc --theme markdown --entryPoint botbuilder-applicationinsights --excludePrivate --includeDeclarations --ignoreCompilerErrors --module amd --out ..\\..\\doc\\botbuilder-applicationinsights .\\lib\\index.d.ts --hideGenerator --name \"Bot Builder SDK - Application Insights\" --readme none",
"build:rollup": "yarn clean && yarn build && api-extractor run --verbose --local",
"clean": "rimraf _ts3.4 lib tsconfig.tsbuildinfo",
"depcheck": "depcheck --config ../../.depcheckrc",
"lint": "eslint .",
"lint": "eslint . --config ../../eslint.config.cjs",
"postbuild": "downlevel-dts lib _ts3.4/lib --checksum",
"test": "npm-run-all build test:mocha",
"test:compat": "api-extractor run --verbose",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/**
* @module botbuilder-applicationinsights
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License

import { TelemetryLoggerMiddleware } from 'botbuilder-core';
import { Middleware } from 'botbuilder-core';
import { TurnContext } from 'botbuilder-core';
import { TelemetryLoggerMiddleware, Middleware, TurnContext } from 'botbuilder-core';
import { CorrelationContext } from 'applicationinsights/out/AutoCollection/CorrelationContextManager';
import * as appInsights from 'applicationinsights';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('TelemetryWaterfall', function () {
if (telemetry.name === 'WaterfallStep') {
assert(
telemetry.properties.StepName === 'Step' + (count + 1) + 'of' + dialog.steps.length,
'waterfallstep step name is wrong'
'waterfallstep step name is wrong',
);
count++;
}
Expand Down Expand Up @@ -252,23 +252,23 @@ describe('TelemetryWaterfall', function () {

assert(
component.findDialog('secondary').telemetryClient instanceof NullTelemetryClient,
'should be nulltelemetryclient by default'
'should be nulltelemetryclient by default',
);
assert(
component.telemetryClient instanceof NullTelemetryClient,
'child dialog should have same telemetry client'
'child dialog should have same telemetry client',
);

component.telemetryClient = new TestClient();

assert(
component.findDialog('secondary').telemetryClient instanceof TestClient,
'child dialogs should now be TestClient'
'child dialogs should now be TestClient',
);
assert(component.telemetryClient instanceof TestClient, 'component should have a testclient as well');
assert(
component.telemetryClient === component.findDialog('secondary').telemetryClient,
'component should have same client as children'
'component should have same client as children',
);

component.addDialog(new WaterfallDialog('third'), [
Expand All @@ -279,29 +279,29 @@ describe('TelemetryWaterfall', function () {

assert(
component.findDialog('third').telemetryClient instanceof TestClient,
'child dialogs should now be TestClient'
'child dialogs should now be TestClient',
);
assert(
component.findDialog('secondary').telemetryClient instanceof TestClient,
'child dialogs should now be TestClient'
'child dialogs should now be TestClient',
);
assert(
component.telemetryClient === component.findDialog('third').telemetryClient,
'component should have same client as new children'
'component should have same client as new children',
);
assert(
component.findDialog('third').telemetryClient === component.findDialog('secondary').telemetryClient,
'children should have identical clients'
'children should have identical clients',
);

component.telemetryClient = null;
assert(
component.findDialog('secondary').telemetryClient instanceof NullTelemetryClient,
'child dialog should be reset to nulltelemetryclient'
'child dialog should be reset to nulltelemetryclient',
);
assert(
component.telemetryClient instanceof NullTelemetryClient,
'component should be reset to nulltelemetryclient'
'component should be reset to nulltelemetryclient',
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ describe('TelemetryInitializerMiddleware', function () {
(err) => {
assert.strictEqual(err.message, 'context is null');
return true;
}
},
);
});

Expand All @@ -175,7 +175,7 @@ describe('TelemetryInitializerMiddleware', function () {
() =>
new Promise((resolve) => {
resolve();
})
}),
);

const updatedContext = appInsights.getCorrelationContext();
Expand All @@ -200,7 +200,7 @@ describe('TelemetryInitializerMiddleware', function () {
() =>
new Promise((resolve) => {
resolve();
})
}),
);

const updatedContext = appInsights.getCorrelationContext();
Expand Down Expand Up @@ -229,7 +229,7 @@ describe('TelemetryInitializerMiddleware', function () {
() =>
new Promise((resolve) => {
resolve();
})
}),
);

const updatedContext = appInsights.getCorrelationContext();
Expand Down

0 comments on commit 89ada0e

Please sign in to comment.