Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply the eslint fixes (from Component Governance Checks) #1596

Merged
merged 2 commits into from
Jul 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are just mixed whitespace issues (had spaces and tabs)

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 @@ -526,7 +526,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 @@ -542,7 +542,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 @@ -553,6 +553,7 @@ export class Initialization implements IApplicationInsights {
// isModule = true;
}
} catch (e) {
// eslint-disable-next-line no-empty
}

if (sdkSrc) {
Expand All @@ -577,6 +578,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
47 changes: 30 additions & 17 deletions common/config/rush/command-line.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/command-line.schema.json",
"commands": [
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/command-line.schema.json",
"commands": [
{
"commandKind": "bulk",
"name": "test",
"summary": "Run all tests for all packages",
"description": "Runs tests for all projects",
"safeForSimultaneousRushProcesses": false,
"enableParallelism": false,
"ignoreMissingScript": false
"commandKind": "bulk",
"name": "test",
"summary": "Run all tests for all packages",
"description": "Runs tests for all projects",
"safeForSimultaneousRushProcesses": false,
"enableParallelism": false,
"ignoreMissingScript": false,
"allowWarningsInSuccessfulBuild": true
},
{
"commandKind": "bulk",
"name": "lint",
"summary": "Run all tslint for all packages",
"description": "Runs tslint for all projects",
"safeForSimultaneousRushProcesses": false,
"enableParallelism": true,
"ignoreMissingScript": false
}
"commandKind": "bulk",
"name": "lint",
"summary": "Run all tslint for all packages",
"description": "Runs tslint for all projects",
"safeForSimultaneousRushProcesses": false,
"enableParallelism": true,
"ignoreMissingScript": false
},
{
"commandKind": "bulk",
"summary": "Run all build for all packages",
"name": "build",
"allowWarningsInSuccessfulBuild": true
},
{
"commandKind": "bulk",
"summary": "Run all build for all packages",
"name": "rebuild",
"allowWarningsInSuccessfulBuild": true
}
]
}
Loading