Skip to content

Commit

Permalink
Apply the eslint fixes (from Component Governance Checks)
Browse files Browse the repository at this point in the history
- Update minimum dependency versions to address installation
  • Loading branch information
MSNev committed Jul 1, 2021
1 parent 110b22f commit ba948f8
Show file tree
Hide file tree
Showing 35 changed files with 1,781 additions and 697 deletions.
15 changes: 8 additions & 7 deletions AISKU/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"build:esm": "grunt aisku",
"build:browser": "rollup -c rollup.config.js",
"build:snippet": "grunt snippetvnext",
"rebuild": "npm run build",
"test": "grunt aiskutests",
"lint": "tslint -p tsconfig.json",
"dtsgen": "api-extractor run --local && node ../scripts/dtsgen.js 'Microsoft.ApplicationInsights'",
Expand All @@ -36,21 +37,21 @@
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
"@types/qunit": "^2.5.3",
"@types/sinon": "4.3.3",
"qunit": "^2.9.1",
"qunit": "^2.11.2",
"sinon": "^7.3.1",
"chromedriver": "^2.45.0",
"@microsoft/api-extractor": "^7.9.11",
"finalhandler": "^1.1.1",
"grunt": "^1.3.0",
"grunt-cli": "^1.3.2",
"grunt-contrib-qunit": "^3.1.0",
"@nevware21/grunt-ts-plugin": "^0.2.2",
"grunt": "^1.4.1",
"grunt-cli": "^1.4.3",
"grunt-contrib-qunit": "^5.0.1",
"@nevware21/grunt-ts-plugin": "^0.3.0",
"grunt-tslint": "^5.0.2",
"globby": "^11.0.0",
"magic-string": "^0.25.7",
"pako":"^2.0.3",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-commonjs": "^18.0.0",
"@rollup/plugin-node-resolve": "^11.2.1",
"@rollup/plugin-replace": "^2.3.3",
"rollup-plugin-cleanup": "3.2.1",
"rollup": "^2.32.0",
Expand Down
40 changes: 21 additions & 19 deletions AISKU/src/Initialization.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import {
IConfiguration, AppInsightsCore, IAppInsightsCore, LoggingSeverity, _InternalMessageId, ITelemetryItem, ICustomProperties,
IChannelControls, hasWindow, hasDocument, isReactNative, doPerf, IDiagnosticLogger, INotificationManager, objForEachKey, proxyAssign,
import {
IConfiguration, AppInsightsCore, IAppInsightsCore, LoggingSeverity, _InternalMessageId, ITelemetryItem, ICustomProperties,
IChannelControls, hasWindow, hasDocument, isReactNative, doPerf, IDiagnosticLogger, INotificationManager, objForEachKey, proxyAssign,
arrForEach, isString, isFunction, isNullOrUndefined, addEventHandler, isArray, throwError, ICookieMgr, safeGetCookieMgr
} from "@microsoft/applicationinsights-core-js";
} from "@microsoft/applicationinsights-core-js";
import { ApplicationInsights } from "@microsoft/applicationinsights-analytics-js";
import { Sender } from "@microsoft/applicationinsights-channel-js";
import { PropertiesPlugin } from "@microsoft/applicationinsights-properties-js";
import { AjaxPlugin as DependenciesPlugin, IDependenciesPlugin } from '@microsoft/applicationinsights-dependencies-js';
import {
IUtil, Util, ICorrelationIdHelper, CorrelationIdHelper, IUrlHelper, UrlHelper, IDateTimeUtils, DateTimeUtils, ConnectionStringParser, FieldType,
import {
IUtil, Util, ICorrelationIdHelper, CorrelationIdHelper, IUrlHelper, UrlHelper, IDateTimeUtils, DateTimeUtils, ConnectionStringParser, FieldType,
IRequestHeaders, RequestHeaders, DisabledPropertyName, ProcessLegacy, SampleRate, HttpMethod, DEFAULT_BREEZE_ENDPOINT, AIData, AIBase,
Envelope, Event, Exception, Metric, PageView, PageViewData, RemoteDependencyData, IEventTelemetry,
ITraceTelemetry, IMetricTelemetry, IDependencyTelemetry, IExceptionTelemetry, IAutoExceptionTelemetry,
IPageViewTelemetry, IPageViewPerformanceTelemetry, Trace, PageViewPerformance, Data, SeverityLevel,
IConfig, ConfigurationManager, ContextTagKeys, IDataSanitizer, DataSanitizer, TelemetryItemCreator, IAppInsights, CtxTagKeys, Extensions,
IPropertiesPlugin, DistributedTracingModes, PropertiesPluginIdentifier, BreezeChannelIdentifier, AnalyticsPluginIdentifier,
IPropertiesPlugin, DistributedTracingModes, PropertiesPluginIdentifier, BreezeChannelIdentifier, AnalyticsPluginIdentifier,
ITelemetryContext as Common_ITelemetryContext, parseConnectionString
} from "@microsoft/applicationinsights-common"

Expand All @@ -28,7 +28,7 @@ let _internalSdkSrc: string;
// This is an exclude list of properties that should not be updated during initialization
// They include a combination of private and internal property names
const _ignoreUpdateSnippetProperties = [
"snippet", "dependencies", "properties", "_snippetVersion", "appInsightsNew", "getSKUDefaults",
"snippet", "dependencies", "properties", "_snippetVersion", "appInsightsNew", "getSKUDefaults",
];

/**
Expand Down Expand Up @@ -58,9 +58,9 @@ export interface IApplicationInsights extends IAppInsights, IDependenciesPlugin,
// export const Telemetry = Common;

let fieldType = {
Default: FieldType.Default,
Required: FieldType.Required,
Array: FieldType.Array,
Default: FieldType.Default,
Required: FieldType.Required,
Array: FieldType.Array,
Hidden: FieldType.Hidden
};

Expand All @@ -77,7 +77,7 @@ export const Telemetry = {
UrlHelper,
DateTimeUtils,
ConnectionStringParser,
FieldType : fieldType,
FieldType: fieldType,
RequestHeaders,
DisabledPropertyName,
ProcessLegacy,
Expand Down Expand Up @@ -155,7 +155,7 @@ export class Initialization implements IApplicationInsights {
/**
* Get the current cookie manager for this instance
*/
public getCookieMgr(): ICookieMgr {
public getCookieMgr(): ICookieMgr {
return this.appInsights.getCookieMgr();
};

Expand Down Expand Up @@ -352,7 +352,7 @@ export class Initialization implements IApplicationInsights {
* @returns {IApplicationInsights}
* @memberof Initialization
*/
public loadAppInsights(legacyMode: boolean = false, logger?: IDiagnosticLogger, notificationManager?: INotificationManager): IApplicationInsights {
public loadAppInsights(legacyMode: boolean = false, logger?: IDiagnosticLogger, notificationManager?: INotificationManager): IApplicationInsights {
let _self = this;

function _updateSnippetProperties(snippet: Snippet) {
Expand Down Expand Up @@ -388,20 +388,20 @@ export class Initialization implements IApplicationInsights {

doPerf(_self.core, () => "AISKU.loadAppInsights", () => {
const extensions = [];

extensions.push(_self._sender);
extensions.push(_self.properties);
extensions.push(_self.dependencies);
extensions.push(_self.appInsights);

// initialize core
_self.core.initialize(_self.config, extensions, logger, notificationManager);
_self.context = _self.properties.context;
if (_internalSdkSrc && _self.context) {
_self.context.internal.sdkSrc = _internalSdkSrc;
}
_updateSnippetProperties(_self.snippet);

// Empty queue of all api calls logged prior to sdk download
_self.emptyQueue();
_self.pollInternalLogs();
Expand Down Expand Up @@ -524,7 +524,7 @@ export class Initialization implements IApplicationInsights {
private getSKUDefaults() {
let _self = this;
_self.config.diagnosticLogInterval =
_self.config.diagnosticLogInterval && _self.config.diagnosticLogInterval > 0 ? _self.config.diagnosticLogInterval : 10000;
_self.config.diagnosticLogInterval && _self.config.diagnosticLogInterval > 0 ? _self.config.diagnosticLogInterval : 10000;
}
}

Expand All @@ -540,7 +540,7 @@ export class Initialization implements IApplicationInsights {
try {
// Try and determine whether the sdk is being loaded from the CDN
// currentScript is only valid during initial processing
let scrpt = (document ||{} as any).currentScript;
let scrpt = (document || {} as any).currentScript;
if (scrpt) {
sdkSrc = scrpt.src;
// } else {
Expand All @@ -551,6 +551,7 @@ export class Initialization implements IApplicationInsights {
// isModule = true;
}
} catch (e) {
// eslint-disable-next-line no-empty
}

if (sdkSrc) {
Expand All @@ -575,6 +576,7 @@ export class Initialization implements IApplicationInsights {
}
}
} catch (e) {
// eslint-disable-next-line no-empty
}
}
})();
12 changes: 6 additions & 6 deletions AISKU/src/applicationinsights-web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ export {
ITelemetryItem,
ITelemetryPlugin,
IPerfEvent,
    IPerfManager, 
    IPerfManagerProvider,
    PerfEvent, 
    PerfManager, 
    doPerf,
IPerfManager,
IPerfManagerProvider,
PerfEvent,
PerfManager,
doPerf,
INotificationListener,
    NotificationManager,
NotificationManager,
IPlugin,
IDiagnosticLogger,
BaseTelemetryPlugin,
Expand Down
13 changes: 7 additions & 6 deletions AISKULight/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"build": "npm run build:esm && npm run build:browser && npm run dtsgen",
"build:esm": "grunt aiskulite",
"build:browser": "rollup -c rollup.config.js",
"rebuild": "npm run build",
"test": "echo 'No tests'",
"lint": "tslint -p tsconfig.json",
"dtsgen": "api-extractor run --local && node ../scripts/dtsgen.js 'Microsoft.ApplicationInsights'"
Expand All @@ -20,15 +21,15 @@
"@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
"@microsoft/api-extractor": "^7.9.11",
"grunt": "^1.3.0",
"grunt-cli": "^1.3.2",
"grunt-contrib-qunit": "^3.1.0",
"grunt": "^1.4.1",
"grunt-cli": "^1.4.3",
"grunt-contrib-qunit": "^5.0.1",
"grunt-run": "^0.8.1",
"@nevware21/grunt-ts-plugin": "^0.2.2",
"@nevware21/grunt-ts-plugin": "^0.3.0",
"globby": "^11.0.0",
"magic-string": "^0.25.7",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-commonjs": "^18.0.0",
"@rollup/plugin-node-resolve": "^11.2.1",
"@rollup/plugin-replace": "^2.3.3",
"rollup-plugin-cleanup": "3.2.1",
"rollup": "^2.32.0",
Expand Down
15 changes: 8 additions & 7 deletions channels/applicationinsights-channel-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"build": "npm run build:esm && npm run build:browser && npm run dtsgen",
"build:esm": "grunt aichannel",
"build:browser": "rollup -c",
"rebuild": "npm run build",
"test": "grunt aichanneltest",
"lint": "tslint -p tsconfig.json",
"dtsgen": "api-extractor run --local && node ../../scripts/dtsgen.js \"Microsoft Application Insights JavaScript SDK Channel\""
Expand All @@ -24,23 +25,23 @@
"@microsoft/api-extractor": "^7.9.11",
"@types/qunit": "^2.5.3",
"@types/sinon": "4.3.3",
"grunt": "^1.3.0",
"grunt-cli": "^1.3.2",
"grunt-contrib-qunit": "^3.1.0",
"grunt": "^1.4.1",
"grunt-cli": "^1.4.3",
"grunt-contrib-qunit": "^5.0.1",
"grunt-run": "^0.8.1",
"@nevware21/grunt-ts-plugin": "^0.2.2",
"@nevware21/grunt-ts-plugin": "^0.3.0",
"globby": "^11.0.0",
"magic-string": "^0.25.7",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-commonjs": "^18.0.0",
"@rollup/plugin-node-resolve": "^11.2.1",
"@rollup/plugin-replace": "^2.3.3",
"rollup-plugin-cleanup": "3.2.1",
"rollup": "^2.32.0",
"typescript": "2.5.3",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"qunit": "^2.9.1",
"qunit": "^2.11.2",
"sinon": "^7.3.1"
},
"dependencies": {
Expand Down
13 changes: 7 additions & 6 deletions common/Tests/Framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"build": "npm run build:esm && npm run build:browser",
"build:esm": "grunt tst-framework",
"build:browser": "rollup -c rollup.config.js",
"rebuild": "npm run build",
"test": ""
},
"repository": {
Expand All @@ -30,19 +31,19 @@
"devDependencies": {
"@types/qunit": "^2.5.3",
"@types/sinon": "4.3.3",
"grunt": "^1.3.0",
"grunt-contrib-qunit": "^3.1.0",
"@nevware21/grunt-ts-plugin": "^0.2.2",
"grunt": "^1.4.1",
"grunt-contrib-qunit": "^5.0.1",
"@nevware21/grunt-ts-plugin": "^0.3.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"tslint-microsoft-contrib": "^5.2.1",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-commonjs": "^18.0.0",
"@rollup/plugin-node-resolve": "^11.2.1",
"@rollup/plugin-replace": "^2.3.3",
"rollup": "^2.32.0",
"typescript": "2.5.3",
"tslib": "^1.13.0",
"qunit": "^2.9.1",
"qunit": "^2.11.2",
"sinon": "^7.3.1",
"globby": "^11.0.0",
"magic-string": "^0.25.7"
Expand Down
Loading

0 comments on commit ba948f8

Please sign in to comment.