diff --git a/app/scripts/modules/amazon/src/aws.settings.ts b/app/scripts/modules/amazon/src/aws.settings.ts index d1627a8501c..73bb09be668 100644 --- a/app/scripts/modules/amazon/src/aws.settings.ts +++ b/app/scripts/modules/amazon/src/aws.settings.ts @@ -28,7 +28,7 @@ export interface IAWSProviderSettings extends IProviderSettings { disableSpotPricing?: boolean; } -export const AWSProviderSettings: IAWSProviderSettings = SETTINGS.providers.aws || { +export const AWSProviderSettings: IAWSProviderSettings = (SETTINGS.providers.aws as IAWSProviderSettings) || { defaults: {}, }; if (AWSProviderSettings) { diff --git a/app/scripts/modules/amazon/src/domain/IAmazonLoadBalancerSourceData.ts b/app/scripts/modules/amazon/src/domain/IAmazonLoadBalancerSourceData.ts index 74b43421fc5..5f671dd44a6 100644 --- a/app/scripts/modules/amazon/src/domain/IAmazonLoadBalancerSourceData.ts +++ b/app/scripts/modules/amazon/src/domain/IAmazonLoadBalancerSourceData.ts @@ -109,10 +109,10 @@ export interface IApplicationLoadBalancerCertificateSourceData { export interface IApplicationLoadBalancerListenerSourceData { certificates?: IApplicationLoadBalancerCertificateSourceData[]; - defaultActions: { + defaultActions: Array<{ targetGroupName: string; type: 'forward'; - }[]; + }>; listenerArn: string; loadBalancerName: string; port: number; @@ -142,16 +142,16 @@ export interface IClassicLoadBalancerSourceData extends IAmazonLoadBalancerSourc unhealthyThreshold: number; }; instances: string[]; - listenerDescriptions: { listener: IClassicListenerSourceData; policyNames: string[] }[]; + listenerDescriptions: Array<{ listener: IClassicListenerSourceData; policyNames: string[] }>; policies: { - appCookieStickinessPolicies: { + appCookieStickinessPolicies: Array<{ CookieName: string; PolicyName: string; - }[]; - lbcookieStickinessPolicies: { + }>; + lbcookieStickinessPolicies: Array<{ CookieExpirationPeriod: string; PolicyName: string; - }[]; + }>; otherPolicies: any[]; }; sourceSecurityGroup: { diff --git a/app/scripts/modules/amazon/src/domain/IAmazonServerGroup.ts b/app/scripts/modules/amazon/src/domain/IAmazonServerGroup.ts index 056e6d1f274..514be434429 100644 --- a/app/scripts/modules/amazon/src/domain/IAmazonServerGroup.ts +++ b/app/scripts/modules/amazon/src/domain/IAmazonServerGroup.ts @@ -9,7 +9,7 @@ export interface IAmazonAsg extends IAsg { healthCheckType: string; healthCheckGracePeriod: number; terminationPolicies: string[]; - enabledMetrics: { metric: string }[]; + enabledMetrics: Array<{ metric: string }>; vpczoneIdentifier?: string; } diff --git a/app/scripts/modules/amazon/src/instance/amazon.instance.write.service.ts b/app/scripts/modules/amazon/src/instance/amazon.instance.write.service.ts index 861411632be..4a04b1d9b83 100644 --- a/app/scripts/modules/amazon/src/instance/amazon.instance.write.service.ts +++ b/app/scripts/modules/amazon/src/instance/amazon.instance.write.service.ts @@ -48,7 +48,7 @@ export class AmazonInstanceWriter extends InstanceWriter { const descriptor = this.buildMultiInstanceDescriptor(jobs, 'Deregister', `from ${targetGroupNames.join(' and ')}`); return this.taskExecutor.executeTask({ job: jobs, - application: application, + application, description: descriptor, }); } @@ -66,7 +66,7 @@ export class AmazonInstanceWriter extends InstanceWriter { params.cloudProvider = instance.cloudProvider; return this.taskExecutor.executeTask({ job: [params], - application: application, + application, description: `Deregister instance: ${instance.id}`, }); } @@ -84,7 +84,7 @@ export class AmazonInstanceWriter extends InstanceWriter { const descriptor = this.buildMultiInstanceDescriptor(jobs, 'Register', `with ${targetGroupNames.join(' and ')}`); return this.taskExecutor.executeTask({ job: jobs, - application: application, + application, description: descriptor, }); } @@ -102,7 +102,7 @@ export class AmazonInstanceWriter extends InstanceWriter { params.cloudProvider = instance.cloudProvider; return this.taskExecutor.executeTask({ job: [params], - application: application, + application, description: `Register instance: ${instance.id}`, }); } diff --git a/app/scripts/modules/amazon/src/loadBalancer/configure/common/LoadBalancerLocation.tsx b/app/scripts/modules/amazon/src/loadBalancer/configure/common/LoadBalancerLocation.tsx index a6c0be0cfe4..58a74b6549f 100644 --- a/app/scripts/modules/amazon/src/loadBalancer/configure/common/LoadBalancerLocation.tsx +++ b/app/scripts/modules/amazon/src/loadBalancer/configure/common/LoadBalancerLocation.tsx @@ -165,7 +165,7 @@ class LoadBalancerLocationImpl extends React.Component< region = this.props.values.region; return ReactInjector.subnetReader.listSubnets().then(subnets => { return chain(subnets) - .filter({ account: account, region: region }) + .filter({ account, region }) .reject({ target: 'ec2' }) .value(); }); diff --git a/app/scripts/modules/amazon/src/loadBalancer/configure/common/SecurityGroups.tsx b/app/scripts/modules/amazon/src/loadBalancer/configure/common/SecurityGroups.tsx index 9815a90e7d6..89646eff7d4 100644 --- a/app/scripts/modules/amazon/src/loadBalancer/configure/common/SecurityGroups.tsx +++ b/app/scripts/modules/amazon/src/loadBalancer/configure/common/SecurityGroups.tsx @@ -20,7 +20,7 @@ import { AWSProviderSettings } from 'amazon/aws.settings'; import { IAmazonClassicLoadBalancerUpsertCommand } from 'amazon/domain'; export interface ISecurityGroupsState { - availableSecurityGroups: { label: string; value: string }[]; + availableSecurityGroups: Array<{ label: string; value: string }>; defaultSecurityGroups: string[]; loaded: boolean; refreshing: boolean; @@ -93,7 +93,7 @@ class SecurityGroupsImpl extends React.Component< const newRemoved = removed.slice(); - let availableSecurityGroups: { label: string; value: string }[] = []; + let availableSecurityGroups: Array<{ label: string; value: string }> = []; if ( account && @@ -158,7 +158,7 @@ class SecurityGroupsImpl extends React.Component< }); } - private handleSecurityGroupsChanged(newValues: { label: string; value: string }[]): void { + private handleSecurityGroupsChanged(newValues: Array<{ label: string; value: string }>): void { this.props.setFieldValue('securityGroups', newValues.map(sg => sg.value)); } diff --git a/app/scripts/modules/amazon/src/loadBalancer/configure/common/createAmazonLoadBalancer.controller.ts b/app/scripts/modules/amazon/src/loadBalancer/configure/common/createAmazonLoadBalancer.controller.ts index 179360d7ebb..ada37f6882f 100644 --- a/app/scripts/modules/amazon/src/loadBalancer/configure/common/createAmazonLoadBalancer.controller.ts +++ b/app/scripts/modules/amazon/src/loadBalancer/configure/common/createAmazonLoadBalancer.controller.ts @@ -282,7 +282,7 @@ export abstract class CreateAmazonLoadBalancerCtrl { region = this.loadBalancerCommand.region; return this.subnetReader.listSubnets().then(subnets => { return chain(subnets) - .filter({ account: account, region: region }) + .filter({ account, region }) .reject({ target: 'ec2' }) .value(); }); diff --git a/app/scripts/modules/amazon/src/loadBalancer/details/LoadBalancerActions.tsx b/app/scripts/modules/amazon/src/loadBalancer/details/LoadBalancerActions.tsx index b40ba164ffd..beecf0b2df4 100644 --- a/app/scripts/modules/amazon/src/loadBalancer/details/LoadBalancerActions.tsx +++ b/app/scripts/modules/amazon/src/loadBalancer/details/LoadBalancerActions.tsx @@ -89,7 +89,7 @@ export class LoadBalancerActions extends React.Component; public loadBalancerFromParams: ILoadBalancerFromStateParams; public loadBalancer: IAmazonLoadBalancer; public securityGroups: ISecurityGroup[]; diff --git a/app/scripts/modules/amazon/src/loadBalancer/loadBalancer.transformer.ts b/app/scripts/modules/amazon/src/loadBalancer/loadBalancer.transformer.ts index 229cf15f962..d7980d3816e 100644 --- a/app/scripts/modules/amazon/src/loadBalancer/loadBalancer.transformer.ts +++ b/app/scripts/modules/amazon/src/loadBalancer/loadBalancer.transformer.ts @@ -293,7 +293,7 @@ export class AwsLoadBalancerTransformer { protocol: listener.protocol, port: listener.port, defaultActions: listener.defaultActions, - certificates: certificates, + certificates, rules: listener.rules || [], sslPolicy: listener.sslPolicy, }; diff --git a/app/scripts/modules/amazon/src/securityGroup/configure/ingressRuleGroupSelector.component.ts b/app/scripts/modules/amazon/src/securityGroup/configure/ingressRuleGroupSelector.component.ts index 7d8b78a71df..ecc4420ecff 100644 --- a/app/scripts/modules/amazon/src/securityGroup/configure/ingressRuleGroupSelector.component.ts +++ b/app/scripts/modules/amazon/src/securityGroup/configure/ingressRuleGroupSelector.component.ts @@ -52,7 +52,7 @@ class IngressRuleSelectorController implements IController { this.regionalVpcs[account].push({ name: vpc.name, region: vpc.region, - account: account, + account, id: vpc.id, label: vpc.label, deprecated: vpc.deprecated, diff --git a/app/scripts/modules/amazon/src/serverGroup/configure/serverGroupConfiguration.service.ts b/app/scripts/modules/amazon/src/serverGroup/configure/serverGroupConfiguration.service.ts index 6e0bdd4572c..bc8c36566ed 100644 --- a/app/scripts/modules/amazon/src/serverGroup/configure/serverGroupConfiguration.service.ts +++ b/app/scripts/modules/amazon/src/serverGroup/configure/serverGroupConfiguration.service.ts @@ -254,7 +254,7 @@ export class AwsServerGroupConfigurationService { public loadImagesFromApplicationName(application: Application, provider: string): any { return this.awsImageReader.findImages({ - provider: provider, + provider, q: application.name.replace(/_/g, '[_\\-]') + '*', }); } diff --git a/app/scripts/modules/amazon/src/serverGroup/configure/wizard/capacity/capacitySelector.component.ts b/app/scripts/modules/amazon/src/serverGroup/configure/wizard/capacity/capacitySelector.component.ts index a106ceb60f0..0e438bb472e 100644 --- a/app/scripts/modules/amazon/src/serverGroup/configure/wizard/capacity/capacitySelector.component.ts +++ b/app/scripts/modules/amazon/src/serverGroup/configure/wizard/capacity/capacitySelector.component.ts @@ -6,7 +6,7 @@ module(CAPACITY_SELECTOR, []).component('awsServerGroupCapacitySelector', { command: '=', }, templateUrl: require('./capacitySelector.component.html'), - controller: function() { + controller() { this.minMaxDesiredTemplate = require('./minMaxDesiredFields.template.html'); this.preferSourceCapacityOptions = [ diff --git a/app/scripts/modules/amazon/src/serverGroup/configure/wizard/securityGroups/securityGroupsRemoved.component.ts b/app/scripts/modules/amazon/src/serverGroup/configure/wizard/securityGroups/securityGroupsRemoved.component.ts index ea6f2948f07..d526be198be 100644 --- a/app/scripts/modules/amazon/src/serverGroup/configure/wizard/securityGroups/securityGroupsRemoved.component.ts +++ b/app/scripts/modules/amazon/src/serverGroup/configure/wizard/securityGroups/securityGroupsRemoved.component.ts @@ -8,7 +8,7 @@ module(SECURITY_GROUPS_REMOVED, []).component('serverGroupSecurityGroupsRemoved' command: '=', removed: '=', }, - controller: function() { + controller() { this.acknowledgeSecurityGroupRemoval = () => { if (has(this.command, 'viewState.dirty')) { this.command.viewState.dirty.securityGroups = null; diff --git a/app/scripts/modules/amazon/src/serverGroup/details/AmazonServerGroupActions.tsx b/app/scripts/modules/amazon/src/serverGroup/details/AmazonServerGroupActions.tsx index 192f9c99d10..0a5d9e8d053 100644 --- a/app/scripts/modules/amazon/src/serverGroup/details/AmazonServerGroupActions.tsx +++ b/app/scripts/modules/amazon/src/serverGroup/details/AmazonServerGroupActions.tsx @@ -82,7 +82,7 @@ export class AmazonServerGroupActions extends React.Component { this.alarm = this.policy.alarms[0]; diff --git a/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/targetTracking/upsertTargetTracking.controller.ts b/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/targetTracking/upsertTargetTracking.controller.ts index d7610155e33..5360b5f1bd1 100644 --- a/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/targetTracking/upsertTargetTracking.controller.ts +++ b/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/targetTracking/upsertTargetTracking.controller.ts @@ -103,7 +103,7 @@ export class UpsertTargetTrackingController implements IComponentController { adjustmentType: null, name: this.policy.policyName, estimatedInstanceWarmup: this.policy.estimatedInstanceWarmup || 600, - targetTrackingConfiguration: Object.assign({}, this.policy.targetTrackingConfiguration), + targetTrackingConfiguration: { ...this.policy.targetTrackingConfiguration }, }; } } diff --git a/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/upsert/alarm/metricSelector.component.spec.ts b/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/upsert/alarm/metricSelector.component.spec.ts index 2cc83919a98..4523fcfc5cf 100644 --- a/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/upsert/alarm/metricSelector.component.spec.ts +++ b/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/upsert/alarm/metricSelector.component.spec.ts @@ -38,11 +38,11 @@ describe('Component: metric selector', () => { ); const initialize = () => { - $ctrl = $componentController( + $ctrl = $componentController( 'awsMetricSelector', { $scope, cloudMetricsReader }, { alarm, serverGroup, alarmUpdated }, - ); + ) as MetricSelectorController; $ctrl.$onInit(); }; diff --git a/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/upsert/alarm/metricSelector.component.ts b/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/upsert/alarm/metricSelector.component.ts index 5fc005a5840..d2afba43961 100644 --- a/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/upsert/alarm/metricSelector.component.ts +++ b/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/upsert/alarm/metricSelector.component.ts @@ -116,17 +116,15 @@ export class MetricSelectorController implements IController { } private buildMetricOption(metric: ICloudMetricDescriptor): IMetricOption { - const option: IMetricOption = Object.assign( - { - label: `(${metric.namespace}) ${metric.name}`, - dimensions: [], - dimensionValues: metric.dimensions - .sort(dimensionSorter) - .map(d => d.value) - .join(', '), - }, - metric, - ); + const option: IMetricOption = { + label: `(${metric.namespace}) ${metric.name}`, + dimensions: [], + dimensionValues: metric.dimensions + .sort(dimensionSorter) + .map(d => d.value) + .join(', '), + ...metric, + }; return option; } diff --git a/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/upsert/step/stepPolicyAction.component.ts b/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/upsert/step/stepPolicyAction.component.ts index d2430d64392..85196526ca8 100644 --- a/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/upsert/step/stepPolicyAction.component.ts +++ b/app/scripts/modules/amazon/src/serverGroup/details/scalingPolicy/upsert/step/stepPolicyAction.component.ts @@ -9,7 +9,7 @@ const stepPolicyActionComponent = { boundsChanged: '&', }, templateUrl: require('./stepPolicyAction.component.html'), - controller: function() { + controller() { this.operatorChanged = () => { this.command.adjustmentType = this.viewState.operator === 'Set to' ? 'ExactCapacity' : 'ChangeInCapacity'; this.adjustmentTypeOptions = diff --git a/app/scripts/modules/amazon/src/serverGroup/details/sections/SecurityGroupsDetailsSection.tsx b/app/scripts/modules/amazon/src/serverGroup/details/sections/SecurityGroupsDetailsSection.tsx index 0526faa5a50..20aa4ff9c33 100644 --- a/app/scripts/modules/amazon/src/serverGroup/details/sections/SecurityGroupsDetailsSection.tsx +++ b/app/scripts/modules/amazon/src/serverGroup/details/sections/SecurityGroupsDetailsSection.tsx @@ -29,7 +29,7 @@ export class SecurityGroupsDetailsSection extends React.Component< securityGroups = chain(serverGroup.launchConfig.securityGroups) .map((id: string) => { return ( - find(app.securityGroups.data, { accountName: serverGroup.account, region: serverGroup.region, id: id }) || + find(app.securityGroups.data, { accountName: serverGroup.account, region: serverGroup.region, id }) || find(app.securityGroups.data, { accountName: serverGroup.account, region: serverGroup.region, name: id }) ); }) diff --git a/app/scripts/modules/amazon/src/serverGroup/serverGroup.transformer.ts b/app/scripts/modules/amazon/src/serverGroup/serverGroup.transformer.ts index c6fc3724c67..f833a178e22 100644 --- a/app/scripts/modules/amazon/src/serverGroup/serverGroup.transformer.ts +++ b/app/scripts/modules/amazon/src/serverGroup/serverGroup.transformer.ts @@ -46,7 +46,7 @@ export class AwsServerGroupTransformer { } public transformScalingPolicy(policy: IScalingPolicy): IScalingPolicyView { - const view: IScalingPolicyView = Object.assign({}, policy) as IScalingPolicyView; + const view: IScalingPolicyView = { ...policy } as IScalingPolicyView; const upperBoundSorter = (a: IStepAdjustmentView, b: IStepAdjustmentView) => b.metricIntervalUpperBound - a.metricIntervalUpperBound, lowerBoundSorter = (a: IStepAdjustmentView, b: IStepAdjustmentView) => @@ -66,7 +66,7 @@ export class AwsServerGroupTransformer { } public normalizeServerGroupDetails(serverGroup: IAmazonServerGroup): IAmazonServerGroupView { - const view: IAmazonServerGroupView = Object.assign({}, serverGroup) as IAmazonServerGroupView; + const view: IAmazonServerGroupView = { ...serverGroup } as IAmazonServerGroupView; if (serverGroup.scalingPolicies) { view.scalingPolicies = serverGroup.scalingPolicies.map(policy => this.transformScalingPolicy(policy)); } diff --git a/app/scripts/modules/amazon/src/validation/applicationName.validator.ts b/app/scripts/modules/amazon/src/validation/applicationName.validator.ts index 99ac3b1c72d..ee010140c0e 100644 --- a/app/scripts/modules/amazon/src/validation/applicationName.validator.ts +++ b/app/scripts/modules/amazon/src/validation/applicationName.validator.ts @@ -74,8 +74,8 @@ class AmazonApplicationNameValidator implements IApplicationNameValidator { } return { - warnings: warnings, - errors: errors, + warnings, + errors, }; } } diff --git a/app/scripts/modules/appengine/src/appengine.settings.ts b/app/scripts/modules/appengine/src/appengine.settings.ts index 314a77a7bcc..38d1449aa88 100644 --- a/app/scripts/modules/appengine/src/appengine.settings.ts +++ b/app/scripts/modules/appengine/src/appengine.settings.ts @@ -8,8 +8,8 @@ export interface IAppengineProviderSettings extends IProviderSettings { }; } -export const AppengineProviderSettings: IAppengineProviderSettings = SETTINGS.providers - .appengine || { defaults: {} }; +export const AppengineProviderSettings: IAppengineProviderSettings = (SETTINGS.providers + .appengine as IAppengineProviderSettings) || { defaults: {} }; if (AppengineProviderSettings) { AppengineProviderSettings.resetToOriginal = SETTINGS.resetProvider('appengine'); } diff --git a/app/scripts/modules/appengine/src/instance/details/details.controller.ts b/app/scripts/modules/appengine/src/instance/details/details.controller.ts index 8d36e232d4e..7d673ac7e67 100644 --- a/app/scripts/modules/appengine/src/instance/details/details.controller.ts +++ b/app/scripts/modules/appengine/src/instance/details/details.controller.ts @@ -68,7 +68,7 @@ class AppengineInstanceDetailsController implements IController { const taskMonitor = { application: this.app, title: 'Terminating ' + shortName, - onTaskComplete: function() { + onTaskComplete() { if (this.$state.includes('**.instanceDetails', { instanceId: instance.name })) { this.$state.go('^'); } @@ -84,7 +84,7 @@ class AppengineInstanceDetailsController implements IController { buttonText: 'Terminate ' + shortName, account: instance.account, taskMonitorConfig: taskMonitor, - submitMethod: submitMethod, + submitMethod, }); } diff --git a/app/scripts/modules/appengine/src/loadBalancer/details/details.controller.ts b/app/scripts/modules/appengine/src/loadBalancer/details/details.controller.ts index a916c474105..c5b1852ee57 100644 --- a/app/scripts/modules/appengine/src/loadBalancer/details/details.controller.ts +++ b/app/scripts/modules/appengine/src/loadBalancer/details/details.controller.ts @@ -79,7 +79,7 @@ class AppengineLoadBalancerDetailsController implements IController { body: this.getConfirmationModalBodyHtml(), account: this.loadBalancer.account, taskMonitorConfig: taskMonitor, - submitMethod: submitMethod, + submitMethod, }); } diff --git a/app/scripts/modules/appengine/src/serverGroup/configure/serverGroupCommandBuilder.service.ts b/app/scripts/modules/appengine/src/serverGroup/configure/serverGroupCommandBuilder.service.ts index 35c2e686d70..35846bafeb3 100644 --- a/app/scripts/modules/appengine/src/serverGroup/configure/serverGroupCommandBuilder.service.ts +++ b/app/scripts/modules/appengine/src/serverGroup/configure/serverGroupCommandBuilder.service.ts @@ -110,7 +110,7 @@ export class AppengineServerGroupCommandBuilder { }; const viewState: IViewState = { - mode: mode, + mode, submitButtonLabel: this.getSubmitButtonLabel(mode), disableStrategySelection: mode === 'create', }; diff --git a/app/scripts/modules/appengine/src/serverGroup/configure/wizard/basicSettings.controller.ts b/app/scripts/modules/appengine/src/serverGroup/configure/wizard/basicSettings.controller.ts index f0503606727..1f540694800 100644 --- a/app/scripts/modules/appengine/src/serverGroup/configure/wizard/basicSettings.controller.ts +++ b/app/scripts/modules/appengine/src/serverGroup/configure/wizard/basicSettings.controller.ts @@ -26,11 +26,11 @@ class AppengineServerGroupBasicSettingsCtrl implements IController { extend( this, $controller('BasicSettingsMixin', { - $scope: $scope, + $scope, imageReader: null, - namingService: namingService, - $uibModalStack: $uibModalStack, - $state: $state, + namingService, + $uibModalStack, + $state, }), ); diff --git a/app/scripts/modules/appengine/src/serverGroup/details/details.controller.ts b/app/scripts/modules/appengine/src/serverGroup/details/details.controller.ts index 594819be9f9..11650fdc24f 100644 --- a/app/scripts/modules/appengine/src/serverGroup/details/details.controller.ts +++ b/app/scripts/modules/appengine/src/serverGroup/details/details.controller.ts @@ -139,7 +139,7 @@ class AppengineServerGroupDetailsController implements IController { account: this.serverGroup.account, provider: 'appengine', taskMonitorConfig: taskMonitor, - submitMethod: submitMethod, + submitMethod, askForReason: true, platformHealthOnlyShowOverride: this.app.attributes.platformHealthOnlyShowOverride, platformHealthType: AppengineHealth.PLATFORM, @@ -166,7 +166,7 @@ class AppengineServerGroupDetailsController implements IController { }; const submitMethod = (params: any) => - this.serverGroupWriter.enableServerGroup(this.serverGroup, this.app, Object.assign(params)); + this.serverGroupWriter.enableServerGroup(this.serverGroup, this.app, { ...params }); const modalBody = `
@@ -190,7 +190,7 @@ class AppengineServerGroupDetailsController implements IController { taskMonitorConfig: taskMonitor, platformHealthOnlyShowOverride: this.app.attributes.platformHealthOnlyShowOverride, platformHealthType: AppengineHealth.PLATFORM, - submitMethod: submitMethod, + submitMethod, askForReason: true, interestingHealthProviderNames: [] as string[], }; @@ -240,7 +240,7 @@ class AppengineServerGroupDetailsController implements IController { taskMonitorConfig: taskMonitor, platformHealthOnlyShowOverride: this.app.attributes.platformHealthOnlyShowOverride, platformHealthType: AppengineHealth.PLATFORM, - submitMethod: submitMethod, + submitMethod, askForReason: true, interestingHealthProviderNames: [] as string[], }; @@ -281,7 +281,7 @@ class AppengineServerGroupDetailsController implements IController { platformHealthOnlyShowOverride: this.app.attributes.platformHealthOnlyShowOverride, platformHealthType: AppengineHealth.PLATFORM, taskMonitorConfig: taskMonitor, - submitMethod: submitMethod, + submitMethod, askForReason: true, }; @@ -304,7 +304,7 @@ class AppengineServerGroupDetailsController implements IController { platformHealthOnlyShowOverride: this.app.attributes.platformHealthOnlyShowOverride, platformHealthType: AppengineHealth.PLATFORM, taskMonitorConfig: taskMonitor, - submitMethod: submitMethod, + submitMethod, askForReason: true, }; @@ -444,7 +444,7 @@ class AppengineServerGroupDetailsController implements IController { }); } - this.serverGroup = Object.assign(serverGroupDetails, fromApp); + this.serverGroup = { ...serverGroupDetails, ...fromApp }; this.state.loading = false; }); } diff --git a/app/scripts/modules/azure/azure.settings.ts b/app/scripts/modules/azure/azure.settings.ts index 50771ea3e3b..3eb6fb45c6e 100644 --- a/app/scripts/modules/azure/azure.settings.ts +++ b/app/scripts/modules/azure/azure.settings.ts @@ -7,7 +7,7 @@ export interface IAzureProviderSettings extends IProviderSettings { }; } -export const AzureProviderSettings: IAzureProviderSettings = SETTINGS.providers.azure || { +export const AzureProviderSettings: IAzureProviderSettings = (SETTINGS.providers.azure as IAzureProviderSettings) || { defaults: {}, }; if (AzureProviderSettings) { diff --git a/app/scripts/modules/canary/canary/CanaryScore.tsx b/app/scripts/modules/canary/canary/CanaryScore.tsx index cbe7a990a40..bc809767414 100644 --- a/app/scripts/modules/canary/canary/CanaryScore.tsx +++ b/app/scripts/modules/canary/canary/CanaryScore.tsx @@ -34,8 +34,8 @@ export class CanaryScore extends React.ComponentSETTINGS - .providers.cf || { defaults: {} }; +export const CloudFoundryProviderSettings: ICloudFoundryProviderSettings = (SETTINGS.providers + .cf as ICloudFoundryProviderSettings) || { defaults: {} }; if (CloudFoundryProviderSettings) { CloudFoundryProviderSettings.resetToOriginal = SETTINGS.resetProvider('cf'); } diff --git a/app/scripts/modules/core/src/api/api.service.spec.ts b/app/scripts/modules/core/src/api/api.service.spec.ts index 89228d52a5c..d10daf664ae 100644 --- a/app/scripts/modules/core/src/api/api.service.spec.ts +++ b/app/scripts/modules/core/src/api/api.service.spec.ts @@ -43,7 +43,7 @@ describe('API Service', function() { .then(noop, () => (rejected = true)); $httpBackend.flush(); - expect((authenticationInitializer.reauthenticateUser).calls.count()).toBe(1); + expect((authenticationInitializer.reauthenticateUser as Spy).calls.count()).toBe(1); expect(rejected).toBe(true); }); @@ -58,7 +58,7 @@ describe('API Service', function() { .then(() => (succeeded = true), () => (rejected = true)); $httpBackend.flush(); - expect((authenticationInitializer.reauthenticateUser).calls.count()).toBe(0); + expect((authenticationInitializer.reauthenticateUser as Spy).calls.count()).toBe(0); expect(rejected).toBe(false); expect(succeeded).toBe(true); }); @@ -74,7 +74,7 @@ describe('API Service', function() { .then(() => (succeeded = true), () => (rejected = true)); $httpBackend.flush(); - expect((authenticationInitializer.reauthenticateUser).calls.count()).toBe(0); + expect((authenticationInitializer.reauthenticateUser as Spy).calls.count()).toBe(0); expect(rejected).toBe(false); expect(succeeded).toBe(true); @@ -87,7 +87,7 @@ describe('API Service', function() { .then(() => (succeeded = true), () => (rejected = true)); $httpBackend.flush(); - expect((authenticationInitializer.reauthenticateUser).calls.count()).toBe(0); + expect((authenticationInitializer.reauthenticateUser as Spy).calls.count()).toBe(0); expect(rejected).toBe(false); expect(succeeded).toBe(true); }); diff --git a/app/scripts/modules/core/src/api/api.service.ts b/app/scripts/modules/core/src/api/api.service.ts index 86c9046ecd6..0dda489cd71 100644 --- a/app/scripts/modules/core/src/api/api.service.ts +++ b/app/scripts/modules/core/src/api/api.service.ts @@ -154,7 +154,7 @@ export class Api { private baseReturn(config: IRequestConfig): IRequestBuilder { return { - config: config, + config, one: this.internalOne(config), all: this.internalOne(config), useCache: this.useCacheFn(config), diff --git a/app/scripts/modules/core/src/application/application.model.spec.ts b/app/scripts/modules/core/src/application/application.model.spec.ts index 0a8bdf4c3f7..f1147090310 100644 --- a/app/scripts/modules/core/src/application/application.model.spec.ts +++ b/app/scripts/modules/core/src/application/application.model.spec.ts @@ -205,7 +205,7 @@ describe('Application Model', function() { type: 'aws', cloudProvider: 'aws', instances: [], - instanceCounts: {}, + instanceCounts: {} as IInstanceCounts, }, ], loadBalancers: ILoadBalancer[] = [], diff --git a/app/scripts/modules/core/src/application/application.model.ts b/app/scripts/modules/core/src/application/application.model.ts index 5300c97805c..68df3d14166 100644 --- a/app/scripts/modules/core/src/application/application.model.ts +++ b/app/scripts/modules/core/src/application/application.model.ts @@ -46,7 +46,7 @@ export class Application { * IFF only one unique value is found, that value is set in the map. Otherwise, the provider is not present in the map * @type {Map} */ - public defaultCredentials: any = {}; + public defaultCredentials: any = {} as any; /** * A map where the key is the provider and the value is the default region value. @@ -54,13 +54,13 @@ export class Application { * IFF only one unique value is found, that value is set in the map. Otherwise, the provider is not present in the map * @type {Map} */ - public defaultRegions: any = {}; + public defaultRegions: any = {} as any; /** * An arbitrary collection of attributes coming from Front50 * @type {Map} */ - public attributes: any = {}; + public attributes: any = {} as any; /** * Indicates that the application was not found in Front50 @@ -211,7 +211,7 @@ export class Application { .filter(v => v.length > 0); const allRegions = union(...vals); if (allRegions.length === 1) { - (results)[provider] = allRegions[0]; + (results as any)[provider] = allRegions[0]; } }); return results; diff --git a/app/scripts/modules/core/src/application/config/dataSources/applicationDataSourceEditor.component.spec.ts b/app/scripts/modules/core/src/application/config/dataSources/applicationDataSourceEditor.component.spec.ts index 6ca9fe75bb2..cf2b6050442 100644 --- a/app/scripts/modules/core/src/application/config/dataSources/applicationDataSourceEditor.component.spec.ts +++ b/app/scripts/modules/core/src/application/config/dataSources/applicationDataSourceEditor.component.spec.ts @@ -14,11 +14,11 @@ describe('Component: Application Data Source Editor', () => { $scope: ng.IScope; const initialize = () => { - ctrl = $componentController( + ctrl = $componentController( 'applicationDataSourceEditor', - { $scope: null, applicationWriter: applicationWriter }, - { application: application }, - ); + { $scope: null, applicationWriter }, + { application }, + ) as DataSourceEditorController; ctrl.$onInit(); }; diff --git a/app/scripts/modules/core/src/application/config/footer/configSectionFooter.component.spec.ts b/app/scripts/modules/core/src/application/config/footer/configSectionFooter.component.spec.ts index b8c9179ea08..283cffdfdb6 100644 --- a/app/scripts/modules/core/src/application/config/footer/configSectionFooter.component.spec.ts +++ b/app/scripts/modules/core/src/application/config/footer/configSectionFooter.component.spec.ts @@ -10,11 +10,11 @@ describe('Component: ConfigSectionFooter', () => { $scope: ng.IScope; const initializeController = (data: any) => { - $ctrl = $componentController( + $ctrl = $componentController( 'configSectionFooter', - { $scope: null, applicationWriter: applicationWriter }, + { $scope: null, applicationWriter }, data, - ); + ) as ConfigSectionFooterController; }; beforeEach(mock.module(CONFIG_SECTION_FOOTER)); diff --git a/app/scripts/modules/core/src/application/listExtractor/listExtractor.service.spec.ts b/app/scripts/modules/core/src/application/listExtractor/listExtractor.service.spec.ts index ae18705e8e4..fbfd7cf513a 100644 --- a/app/scripts/modules/core/src/application/listExtractor/listExtractor.service.spec.ts +++ b/app/scripts/modules/core/src/application/listExtractor/listExtractor.service.spec.ts @@ -38,7 +38,7 @@ describe('appListExtractorService', function() { app: 'test-application', }; const filterByCluster = (serverGroup: IServerGroup) => serverGroup.moniker.cluster === 'test-cluster'; - const applicationA: Application = buildApplication([{ moniker: moniker }]); + const applicationA: Application = buildApplication([{ moniker }]); const applicationB: Application = buildApplication(); const result = service.getMonikers([applicationA, applicationB], filterByCluster); @@ -58,7 +58,7 @@ describe('appListExtractorService', function() { cluster: 'test-cluster', app: 'test-application', }; - const application: Application = buildApplication([{ moniker: moniker }]); + const application: Application = buildApplication([{ moniker }]); const result = service.getMonikers([application]); expect(result.length).toEqual(1); expect(result).toEqual([moniker]); @@ -69,7 +69,7 @@ describe('appListExtractorService', function() { cluster: 'test-cluster', app: 'test-application', }; - const applicationA: Application = buildApplication([{ moniker: moniker }]); + const applicationA: Application = buildApplication([{ moniker }]); const applicationB: Application = buildApplication(); const result = service.getMonikers([applicationA, applicationB]); expect(result.length).toEqual(1); diff --git a/app/scripts/modules/core/src/application/listExtractor/listExtractor.service.ts b/app/scripts/modules/core/src/application/listExtractor/listExtractor.service.ts index e40cd02f818..a83fd362960 100644 --- a/app/scripts/modules/core/src/application/listExtractor/listExtractor.service.ts +++ b/app/scripts/modules/core/src/application/listExtractor/listExtractor.service.ts @@ -4,13 +4,9 @@ import { IInstance, IServerGroup } from 'core/domain'; import { Application } from '../application.model'; import { IMoniker } from 'core/naming/IMoniker'; -export interface IServerGroupFilter { - (s: IServerGroup): boolean; -} +export type IServerGroupFilter = (s: IServerGroup) => boolean; -export interface IInstanceFilter { - (i: IInstance): boolean; -} +export type IInstanceFilter = (i: IInstance) => boolean; const defaultFilter = () => true; diff --git a/app/scripts/modules/core/src/application/modal/validation/applicationName.validator.ts b/app/scripts/modules/core/src/application/modal/validation/applicationName.validator.ts index 7505ca549ec..f713df954fa 100644 --- a/app/scripts/modules/core/src/application/modal/validation/applicationName.validator.ts +++ b/app/scripts/modules/core/src/application/modal/validation/applicationName.validator.ts @@ -64,8 +64,8 @@ export class ApplicationNameValidator { if (this.providerMap.has(provider)) { this.providerMap.get(provider).forEach(validator => { const results = validator.validate(applicationName); - results.warnings.forEach(message => warnings.push({ cloudProvider: provider, message: message })); - results.errors.forEach(message => errors.push({ cloudProvider: provider, message: message })); + results.warnings.forEach(message => warnings.push({ cloudProvider: provider, message })); + results.errors.forEach(message => errors.push({ cloudProvider: provider, message })); }); } }); diff --git a/app/scripts/modules/core/src/application/modal/validation/exampleApplicationName.validator.ts b/app/scripts/modules/core/src/application/modal/validation/exampleApplicationName.validator.ts index e893b5fbdae..3431d4792df 100644 --- a/app/scripts/modules/core/src/application/modal/validation/exampleApplicationName.validator.ts +++ b/app/scripts/modules/core/src/application/modal/validation/exampleApplicationName.validator.ts @@ -55,8 +55,8 @@ export class ExampleApplicationNameValidator implements IApplicationNameValidato } return { - warnings: warnings, - errors: errors, + warnings, + errors, }; } } @@ -108,8 +108,8 @@ export class ExampleApplicationNameValidator2 implements IApplicationNameValidat } return { - warnings: warnings, - errors: errors, + warnings, + errors, }; } } diff --git a/app/scripts/modules/core/src/application/modal/validation/validateApplicationName.directive.ts b/app/scripts/modules/core/src/application/modal/validation/validateApplicationName.directive.ts index 6e3632d9ed2..e2b5c210986 100644 --- a/app/scripts/modules/core/src/application/modal/validation/validateApplicationName.directive.ts +++ b/app/scripts/modules/core/src/application/modal/validation/validateApplicationName.directive.ts @@ -74,5 +74,5 @@ export const VALIDATE_APPLICATION_NAME = 'spinnaker.core.application.modal.valid module(VALIDATE_APPLICATION_NAME, [APPLICATION_NAME_VALIDATOR]).directive( 'validateApplicationName', - ValidateApplicationNameDirective, + ValidateApplicationNameDirective as any, ); diff --git a/app/scripts/modules/core/src/application/nav/ApplicationHeader.tsx b/app/scripts/modules/core/src/application/nav/ApplicationHeader.tsx index 8d0b9752a23..9a0531c60db 100644 --- a/app/scripts/modules/core/src/application/nav/ApplicationHeader.tsx +++ b/app/scripts/modules/core/src/application/nav/ApplicationHeader.tsx @@ -41,9 +41,10 @@ export class ApplicationHeader extends React.Component ds.category === c.key); if (matchedSources.length) { - categories.push(Object.assign(c, { dataSources: matchedSources })); + categories.push({ ...c, dataSources: matchedSources }); } } }); diff --git a/app/scripts/modules/core/src/application/service/application.read.service.spec.ts b/app/scripts/modules/core/src/application/service/application.read.service.spec.ts index 91ac03c7b05..34473e2c55f 100644 --- a/app/scripts/modules/core/src/application/service/application.read.service.spec.ts +++ b/app/scripts/modules/core/src/application/service/application.read.service.spec.ts @@ -89,23 +89,23 @@ describe('Service: applicationReader', function() { it('loads all data sources if dataSource attribute is missing', function() { loadApplication(); expect(application.attributes.dataSources).toBeUndefined(); - expect((clusterService.loadServerGroups).calls.count()).toBe(1); - expect((securityGroupReader.getApplicationSecurityGroups).calls.count()).toBe(1); + expect((clusterService.loadServerGroups as Spy).calls.count()).toBe(1); + expect((securityGroupReader.getApplicationSecurityGroups as Spy).calls.count()).toBe(1); expect(loadBalancerReader.loadLoadBalancers.calls.count()).toBe(1); }); it('loads all data sources if disabled dataSource attribute is an empty array', function() { loadApplication({ enabled: [], disabled: [] }); - expect((clusterService.loadServerGroups).calls.count()).toBe(1); - expect((securityGroupReader.getApplicationSecurityGroups).calls.count()).toBe(1); + expect((clusterService.loadServerGroups as Spy).calls.count()).toBe(1); + expect((securityGroupReader.getApplicationSecurityGroups as Spy).calls.count()).toBe(1); expect(loadBalancerReader.loadLoadBalancers.calls.count()).toBe(1); }); it('only loads configured dataSources if attribute is non-empty', function() { const dataSources = { enabled: ['serverGroups'], disabled: ['securityGroups', 'loadBalancers'] }; loadApplication(dataSources); - expect((clusterService.loadServerGroups).calls.count()).toBe(1); - expect((securityGroupReader.getApplicationSecurityGroups).calls.count()).toBe(0); + expect((clusterService.loadServerGroups as Spy).calls.count()).toBe(1); + expect((securityGroupReader.getApplicationSecurityGroups as Spy).calls.count()).toBe(0); expect(loadBalancerReader.loadLoadBalancers.calls.count()).toBe(0); expect(application.getDataSource('serverGroups').disabled).toBe(false); diff --git a/app/scripts/modules/core/src/application/service/application.write.service.ts b/app/scripts/modules/core/src/application/service/application.write.service.ts index dcc06831d8f..75e02632357 100644 --- a/app/scripts/modules/core/src/application/service/application.write.service.ts +++ b/app/scripts/modules/core/src/application/service/application.write.service.ts @@ -20,7 +20,7 @@ export class ApplicationWriter { const jobs: IJob[] = this.buildJobs(application, 'createApplication', cloneDeep); return this.taskExecutor.executeTask({ job: jobs, - application: application, + application, description: 'Create Application: ' + application.name, }); } @@ -29,7 +29,7 @@ export class ApplicationWriter { const jobs: IJob[] = this.buildJobs(application, 'updateApplication', cloneDeep); return this.taskExecutor.executeTask({ job: jobs, - application: application, + application, description: 'Update Application: ' + application.name, }); } @@ -41,7 +41,7 @@ export class ApplicationWriter { return this.taskExecutor .executeTask({ job: jobs, - application: application, + application, description: 'Deleting Application: ' + application.name, }) .then((task: any): any => { @@ -59,7 +59,7 @@ export class ApplicationWriter { } delete command.accounts; jobs.push({ - type: type, + type, application: command, }); return jobs; diff --git a/app/scripts/modules/core/src/application/service/applicationDataSource.ts b/app/scripts/modules/core/src/application/service/applicationDataSource.ts index af838d9ccf1..31e1a21a18c 100644 --- a/app/scripts/modules/core/src/application/service/applicationDataSource.ts +++ b/app/scripts/modules/core/src/application/service/applicationDataSource.ts @@ -262,7 +262,7 @@ export class ApplicationDataSource implements IDataSourceConfig { * Dumb queue to fire when the most recent refresh call finishes * (will go away when we switch from Promises to Observables) */ - private refreshQueue: IDeferred[] = []; + private refreshQueue: Array> = []; /** * Called when a method mutates some item in the data source's data, e.g. when a running execution is updated diff --git a/app/scripts/modules/core/src/application/service/inferredApplicationWarning.service.spec.ts b/app/scripts/modules/core/src/application/service/inferredApplicationWarning.service.spec.ts index 92c73af2974..4a506dd8da4 100644 --- a/app/scripts/modules/core/src/application/service/inferredApplicationWarning.service.spec.ts +++ b/app/scripts/modules/core/src/application/service/inferredApplicationWarning.service.spec.ts @@ -61,7 +61,7 @@ describe('Service: inferredApplicationWarning', () => { inferredApplicationWarningService.checkIfInferredAndWarn(inferredApp); inferredApplicationWarningService.checkIfInferredAndWarn(inferredApp); - expect((notifierService.publish).calls.count()).toEqual(1); + expect((notifierService.publish as Spy).calls.count()).toEqual(1); }); }); }); diff --git a/app/scripts/modules/core/src/artifact/ArtifactReferenceService.spec.ts b/app/scripts/modules/core/src/artifact/ArtifactReferenceService.spec.ts index 52fd0e35ee7..0046b76ea15 100644 --- a/app/scripts/modules/core/src/artifact/ArtifactReferenceService.spec.ts +++ b/app/scripts/modules/core/src/artifact/ArtifactReferenceService.spec.ts @@ -1,16 +1,12 @@ import { ArtifactReferenceServiceProvider } from './ArtifactReferenceService'; -const stage = (mixin: any) => - Object.assign( - {}, - { - name: 'name', - type: 'foobar', - refId: 'x', - requisiteStageRefIds: [], - }, - mixin, - ); +const stage = (mixin: any) => ({ + name: 'name', + type: 'foobar', + refId: 'x', + requisiteStageRefIds: [], + ...mixin, +}); describe('ArtifactReferenceService', () => { let svc: ArtifactReferenceServiceProvider; diff --git a/app/scripts/modules/core/src/artifact/ArtifactReferenceService.ts b/app/scripts/modules/core/src/artifact/ArtifactReferenceService.ts index 4c883e2d10c..e10d70de003 100644 --- a/app/scripts/modules/core/src/artifact/ArtifactReferenceService.ts +++ b/app/scripts/modules/core/src/artifact/ArtifactReferenceService.ts @@ -4,9 +4,7 @@ import { isEmpty, get } from 'lodash'; export type SupportedStage = 'stage'; -interface IWalker { - (refContainer: any): (string | number)[][]; -} +type IWalker = (refContainer: any) => Array[]; interface IReference { category: SupportedStage; @@ -27,7 +25,7 @@ export class ArtifactReferenceServiceProvider { public removeReferenceFromStages(reference: string, stages: IStage[]) { (stages || []).forEach(stage => { this.references.forEach(ref => { - const paths: (string | number)[][] = ref.walker(stage).filter(path => !isEmpty(path)); + const paths: Array[] = ref.walker(stage).filter(path => !isEmpty(path)); paths.map(p => p.slice(0)).forEach(path => { let tail = path.pop(); let obj = stage; diff --git a/app/scripts/modules/core/src/authentication/authentication.module.ts b/app/scripts/modules/core/src/authentication/authentication.module.ts index e10189e359f..07076c83f82 100644 --- a/app/scripts/modules/core/src/authentication/authentication.module.ts +++ b/app/scripts/modules/core/src/authentication/authentication.module.ts @@ -22,7 +22,7 @@ angular }) .factory('gateRequestInterceptor', function() { return { - request: function(config: ng.IRequestConfig) { + request(config: ng.IRequestConfig) { if (config.url.indexOf(SETTINGS.gateUrl) === 0) { config.withCredentials = true; } diff --git a/app/scripts/modules/core/src/authentication/authentication.service.ts b/app/scripts/modules/core/src/authentication/authentication.service.ts index a2a72f6ca34..3b3faa404f5 100644 --- a/app/scripts/modules/core/src/authentication/authentication.service.ts +++ b/app/scripts/modules/core/src/authentication/authentication.service.ts @@ -24,7 +24,7 @@ export class AuthenticationService implements IAuthenticationService { private authEvents: Function[] = []; public getAuthenticatedUser(): IUser { - return Object.assign({}, this.user); + return { ...this.user }; } public setAuthenticatedUser(authenticatedUser: IUser): void { diff --git a/app/scripts/modules/core/src/authentication/userMenu/userMenu.directive.ts b/app/scripts/modules/core/src/authentication/userMenu/userMenu.directive.ts index 86576c61b1a..bfaa5f316c4 100644 --- a/app/scripts/modules/core/src/authentication/userMenu/userMenu.directive.ts +++ b/app/scripts/modules/core/src/authentication/userMenu/userMenu.directive.ts @@ -13,7 +13,7 @@ ngmodule.directive('userMenu', function(authenticationService: any, authenticati restrict: 'E', replace: true, templateUrl: require('./userMenu.directive.html'), - link: function(scope: any) { + link(scope: any) { scope.authEnabled = SETTINGS.authEnabled; scope.user = authenticationService.getAuthenticatedUser(); scope.showLogOutDropdown = () => authenticationService.getAuthenticatedUser().authenticated; diff --git a/app/scripts/modules/core/src/bootstrap/bootstrap.module.ts b/app/scripts/modules/core/src/bootstrap/bootstrap.module.ts index 32a5725df83..4b97835d148 100644 --- a/app/scripts/modules/core/src/bootstrap/bootstrap.module.ts +++ b/app/scripts/modules/core/src/bootstrap/bootstrap.module.ts @@ -5,4 +5,4 @@ import { OVERRIDE_REGISTRY } from 'core/overrideRegistry/override.registry'; import { SPINNAKER_HEADER } from 'core/header/spinnakerHeader.component'; export const APPLICATION_BOOTSTRAP_MODULE = 'spinnaker.core.applicationBootstrap'; -export const bootstrapModule = module(APPLICATION_BOOTSTRAP_MODULE, [OVERRIDE_REGISTRY, SPINNAKER_HEADER]); +export const bootstrapModule = module(APPLICATION_BOOTSTRAP_MODULE, [OVERRIDE_REGISTRY, SPINNAKER_HEADER]) as IModule; diff --git a/app/scripts/modules/core/src/bootstrap/stateChange.logger.ts b/app/scripts/modules/core/src/bootstrap/stateChange.logger.ts index e881527c90f..31a6ccbeba2 100644 --- a/app/scripts/modules/core/src/bootstrap/stateChange.logger.ts +++ b/app/scripts/modules/core/src/bootstrap/stateChange.logger.ts @@ -10,7 +10,7 @@ bootstrapModule.run(($uiRouter: UIRouter, $log: ILogService) => { const subscription = $uiRouter.globals.start$.subscribe((transition: Transition) => { const details = { - transition: transition, + transition, toState: transition.to(), toParams: transition.params('to'), fromState: transition.from(), @@ -19,7 +19,7 @@ bootstrapModule.run(($uiRouter: UIRouter, $log: ILogService) => { $log.debug('$stateChangeStart', details); const success = () => $log.debug('$stateChangeSuccess', details); - const failure = (error: any) => $log.debug('$stateChangeError', Object.assign(details, { error })); + const failure = (error: any) => $log.debug('$stateChangeError', { ...details, error }); transition.promise.then(success, failure); }); diff --git a/app/scripts/modules/core/src/cache/cacheInitializer.service.ts b/app/scripts/modules/core/src/cache/cacheInitializer.service.ts index 04977811db4..04fb1ec8f52 100644 --- a/app/scripts/modules/core/src/cache/cacheInitializer.service.ts +++ b/app/scripts/modules/core/src/cache/cacheInitializer.service.ts @@ -32,7 +32,7 @@ export class CacheInitializerService { private setConfigDefaults(key: string, config: ICacheConfig) { config.version = config.version || 1; config.maxAge = config.maxAge || moment.duration(2, 'days').asMilliseconds(); - config.initializers = config.initializers || this.initializers[key] || []; + config.initializers = config.initializers || this.initializers[key] || ([] as any[]); config.onReset = config.onReset || [noop]; } @@ -70,7 +70,7 @@ export class CacheInitializerService { this.infrastructureCaches.createCache(key, this.cacheConfig[key]); if (this.cacheConfig[key].initializers) { const initializer: any = this.cacheConfig[key].initializers; - const all: ng.IPromise[] = []; + const all: Array> = []; initializer.forEach((method: Function) => { all.push(method()); }); @@ -109,7 +109,7 @@ export class CacheInitializerService { } public refreshCaches(): ng.IPromise { - const all: ng.IPromise[] = []; + const all: Array> = []; Object.keys(this.cacheConfig).forEach((key: string) => { all.push(this.refreshCache(key)); }); diff --git a/app/scripts/modules/core/src/cache/infrastructureCaches.service.spec.ts b/app/scripts/modules/core/src/cache/infrastructureCaches.service.spec.ts index a6310035cee..37a7abbf862 100644 --- a/app/scripts/modules/core/src/cache/infrastructureCaches.service.spec.ts +++ b/app/scripts/modules/core/src/cache/infrastructureCaches.service.spec.ts @@ -89,7 +89,7 @@ describe('spinnaker.core.cache.infrastructure', function() { expect(cacheFactory.getCacheInstantiations().length).toBe(3); for (let i = 0; i < 3; i++) { - expect((cacheFactory.getCacheInstantiations()[i].config).storagePrefix).toBe( + expect((cacheFactory.getCacheInstantiations()[i].config as ICacheConfigOptions).storagePrefix).toBe( DeckCacheService.getStoragePrefix('infrastructure:myCache', i), ); } @@ -104,10 +104,10 @@ describe('spinnaker.core.cache.infrastructure', function() { infrastructureCacheService.createCache('myCache', config); expect(cacheFactory.getCacheInstantiations().length).toBe(2); - expect((cacheFactory.getCacheInstantiations()[0].config).storagePrefix).toBe( + expect((cacheFactory.getCacheInstantiations()[0].config as ICacheConfigOptions).storagePrefix).toBe( DeckCacheService.getStoragePrefix('infrastructure:myCache', 0), ); - expect((cacheFactory.getCacheInstantiations()[1].config).storagePrefix).toBe( + expect((cacheFactory.getCacheInstantiations()[1].config as ICacheConfigOptions).storagePrefix).toBe( DeckCacheService.getStoragePrefix('infrastructure:myCache', 1), ); expect(cacheFactory.getRemoveAllCalls().length).toBe(1); diff --git a/app/scripts/modules/core/src/cancelModal/cancelModal.service.ts b/app/scripts/modules/core/src/cancelModal/cancelModal.service.ts index cbc41163566..9375e91553f 100644 --- a/app/scripts/modules/core/src/cancelModal/cancelModal.service.ts +++ b/app/scripts/modules/core/src/cancelModal/cancelModal.service.ts @@ -18,7 +18,7 @@ export class CancelModalService { public constructor(private $uibModal: IModalService, private $sce: ng.ISCEService) {} public confirm(params: ICancelModalParams): ng.IPromise { - const extendedParams: ICancelModalParams = Object.assign({}, this.defaults, params); + const extendedParams: ICancelModalParams = { ...this.defaults, ...params }; if (extendedParams.body) { extendedParams.body = this.$sce.trustAsHtml(extendedParams.body); diff --git a/app/scripts/modules/core/src/chaosMonkey/chaosMonkeyExceptions.component.spec.ts b/app/scripts/modules/core/src/chaosMonkey/chaosMonkeyExceptions.component.spec.ts index 00f4600fbeb..a547f75cb98 100644 --- a/app/scripts/modules/core/src/chaosMonkey/chaosMonkeyExceptions.component.spec.ts +++ b/app/scripts/modules/core/src/chaosMonkey/chaosMonkeyExceptions.component.spec.ts @@ -14,11 +14,11 @@ describe('Controller: ChaosMonkeyExceptions', () => { applicationBuilder: ApplicationModelBuilder; const initializeController = (data: any) => { - $ctrl = $componentController( + $ctrl = $componentController( 'chaosMonkeyExceptions', - { $scope: null, accountService: accountService, $q: $q }, + { $scope: null, accountService, $q }, data, - ); + ) as ChaosMonkeyExceptionsController; }; beforeEach(mock.module(APPLICATION_MODEL_BUILDER, CHAOS_MONKEY_EXCEPTIONS_COMPONENT)); diff --git a/app/scripts/modules/core/src/chaosMonkey/chaosMonkeyExceptions.component.ts b/app/scripts/modules/core/src/chaosMonkey/chaosMonkeyExceptions.component.ts index 4f82a5dcf8a..8863478bb06 100644 --- a/app/scripts/modules/core/src/chaosMonkey/chaosMonkeyExceptions.component.ts +++ b/app/scripts/modules/core/src/chaosMonkey/chaosMonkeyExceptions.component.ts @@ -58,7 +58,7 @@ export class ChaosMonkeyExceptionsController { this.clusterMatches.length = 0; this.config.exceptions.forEach((exception: IChaosMonkeyExceptionRule) => { // the "location" field in chaos monkey exceptions is mapped as "region", so we have to massage it a bit... - const rule: IClusterMatchRule = Object.assign({}, exception, { location: exception.region }); + const rule: IClusterMatchRule = { ...exception, location: exception.region }; this.clusterMatches.push( this.application.clusters .filter(c => diff --git a/app/scripts/modules/core/src/cloudProvider/cloudProvider.registry.ts b/app/scripts/modules/core/src/cloudProvider/cloudProvider.registry.ts index dea31de6b95..bbf195b316d 100644 --- a/app/scripts/modules/core/src/cloudProvider/cloudProvider.registry.ts +++ b/app/scripts/modules/core/src/cloudProvider/cloudProvider.registry.ts @@ -18,7 +18,7 @@ export interface ICloudProviderConfig { } class Providers { - private providers: { cloudProvider: string; config: ICloudProviderConfig }[] = []; + private providers: Array<{ cloudProvider: string; config: ICloudProviderConfig }> = []; public set(cloudProvider: string, config: ICloudProviderConfig): void { // The original implementation used a Map, so calling #set could overwrite a config. diff --git a/app/scripts/modules/core/src/cloudProvider/providerSelection/providerSelection.service.ts b/app/scripts/modules/core/src/cloudProvider/providerSelection/providerSelection.service.ts index 9270a3ac395..6dfd60b642b 100644 --- a/app/scripts/modules/core/src/cloudProvider/providerSelection/providerSelection.service.ts +++ b/app/scripts/modules/core/src/cloudProvider/providerSelection/providerSelection.service.ts @@ -11,9 +11,7 @@ import { } from 'core/cloudProvider/cloudProvider.registry'; import { SETTINGS } from 'core/config/settings'; -export interface IProviderSelectionFilter { - (app: Application, acc: IAccountDetails, prov: ICloudProviderConfig): boolean; -} +export type IProviderSelectionFilter = (app: Application, acc: IAccountDetails, prov: ICloudProviderConfig) => boolean; export class ProviderSelectionService { constructor( diff --git a/app/scripts/modules/core/src/cloudProvider/skin.service.ts b/app/scripts/modules/core/src/cloudProvider/skin.service.ts index 65624678782..5aa7dee77d3 100644 --- a/app/scripts/modules/core/src/cloudProvider/skin.service.ts +++ b/app/scripts/modules/core/src/cloudProvider/skin.service.ts @@ -85,7 +85,7 @@ export class SkinService { ); }; - const all: (IServerGroup | ILoadBalancer)[] = [] + const all: Array = [] .concat(serverGroups) .concat(loadBalancers) .concat(loadBalancerServerGroups); diff --git a/app/scripts/modules/core/src/cluster/cluster.service.spec.ts b/app/scripts/modules/core/src/cluster/cluster.service.spec.ts index bf68ff131ca..4c1b300de73 100644 --- a/app/scripts/modules/core/src/cluster/cluster.service.spec.ts +++ b/app/scripts/modules/core/src/cluster/cluster.service.spec.ts @@ -21,7 +21,7 @@ describe('Service: Cluster', function() { return { status: config.status, getValueFor: (key: string): any => { - return find(config.variables, { key: key }) ? find(config.variables, { key: key }).value : null; + return find(config.variables, { key }) ? find(config.variables, { key }).value : null; }, }; } diff --git a/app/scripts/modules/core/src/cluster/cluster.service.ts b/app/scripts/modules/core/src/cluster/cluster.service.ts index fb4597ccee4..027deee072c 100644 --- a/app/scripts/modules/core/src/cluster/cluster.service.ts +++ b/app/scripts/modules/core/src/cluster/cluster.service.ts @@ -132,8 +132,8 @@ export class ClusterService { const groupedByCluster = groupBy(categoryServerGroups, 'cluster'); forOwn(groupedByCluster, (clusterServerGroups, clusterName) => { const cluster: ICluster = { - account: account, - category: category, + account, + category, name: clusterName, serverGroups: clusterServerGroups, cloudProvider: clusterServerGroups[0].cloudProvider, diff --git a/app/scripts/modules/core/src/cluster/clusterSearchResultType.tsx b/app/scripts/modules/core/src/cluster/clusterSearchResultType.tsx index 1e39ede921c..7decc22f238 100644 --- a/app/scripts/modules/core/src/cluster/clusterSearchResultType.tsx +++ b/app/scripts/modules/core/src/cluster/clusterSearchResultType.tsx @@ -76,7 +76,7 @@ class ClustersSearchResultType extends SearchResultType { private makeSearchResult(serverGroup: IServerGroupSearchResult): IClusterSearchResult { const type = this.id; const urlBuilder = urlBuilderRegistry.getBuilder(type); - const href = urlBuilder.build(Object.assign({ type }, serverGroup), ReactInjector.$state); + const href = urlBuilder.build({ type, ...serverGroup }, ReactInjector.$state); const { account, application, cluster, provider, stack } = serverGroup; return { account, application, cluster, provider, stack, displayName: cluster, href, type }; diff --git a/app/scripts/modules/core/src/cluster/filter/clusterFilter.service.ts b/app/scripts/modules/core/src/cluster/filter/clusterFilter.service.ts index dd317078560..260fd9f7208 100644 --- a/app/scripts/modules/core/src/cluster/filter/clusterFilter.service.ts +++ b/app/scripts/modules/core/src/cluster/filter/clusterFilter.service.ts @@ -88,7 +88,7 @@ export class ClusterFilterService { forOwn(regionGroupings, (regionGroup: IServerGroup[], region: string) => { regionGroups.push({ heading: region, - category: category, + category, serverGroups: regionGroup, key: `${region}:${category}`, entityTags: (regionGroup[0].clusterEntityTags || []).find(t => t.entityRef['region'] === region), @@ -102,7 +102,7 @@ export class ClusterFilterService { if (appCluster) { clusterGroups.push({ heading: cluster, - category: category, + category, key: `${cluster}:${category}`, cluster: appCluster, subgroups: sortBy(regionGroups, 'heading'), diff --git a/app/scripts/modules/core/src/cluster/onDemand/onDemandClusterPicker.component.ts b/app/scripts/modules/core/src/cluster/onDemand/onDemandClusterPicker.component.ts index 7afcccae499..cbb8599cd8a 100644 --- a/app/scripts/modules/core/src/cluster/onDemand/onDemandClusterPicker.component.ts +++ b/app/scripts/modules/core/src/cluster/onDemand/onDemandClusterPicker.component.ts @@ -56,7 +56,7 @@ const template = ` `; const onDemandClusterPickerComponent: IComponentOptions = { - template: template, + template, controller: OnDemandClusterPickerController, bindings: { application: '<', diff --git a/app/scripts/modules/core/src/cluster/task.matcher.ts b/app/scripts/modules/core/src/cluster/task.matcher.ts index 28c7440fa4b..1b4a9f279a0 100644 --- a/app/scripts/modules/core/src/cluster/task.matcher.ts +++ b/app/scripts/modules/core/src/cluster/task.matcher.ts @@ -2,9 +2,7 @@ import { has, intersection, map } from 'lodash'; import { IServerGroup, ITask } from 'core/domain'; -export interface ITaskMatcher { - (task: ITask, serverGroup: IServerGroup): boolean; -} +export type ITaskMatcher = (task: ITask, serverGroup: IServerGroup) => boolean; /** * Match running tasks for an application to a specific server group. @@ -53,7 +51,7 @@ export class TaskMatcher { } public taskMatches(task: ITask, serverGroup: IServerGroup) { - const matchers: { [type: string]: ITaskMatcher } = Object.assign({}, this.customMatchers); + const matchers: { [type: string]: ITaskMatcher } = { ...this.customMatchers }; this.instanceIdMatchers.forEach(m => (matchers[m] = instanceIdsTaskMatcher)); this.baseTaskMatchers.forEach(m => (matchers[m] = baseTaskMatcher)); diff --git a/app/scripts/modules/core/src/config/settings.ts b/app/scripts/modules/core/src/config/settings.ts index bb6d3affab0..eccc399cad6 100644 --- a/app/scripts/modules/core/src/config/settings.ts +++ b/app/scripts/modules/core/src/config/settings.ts @@ -72,7 +72,7 @@ export interface ISpinnakerSettings { }; executionWindow?: { atlas?: { - regions: { label: string; baseUrl: string }[]; + regions: Array<{ label: string; baseUrl: string }>; url: string; }; }; @@ -98,7 +98,7 @@ export interface ISpinnakerSettings { dockerInsights: IDockerInsightSettings; } -export const SETTINGS: ISpinnakerSettings = (window).spinnakerSettings; +export const SETTINGS: ISpinnakerSettings = (window as any).spinnakerSettings; // Make sure to set up some reasonable default settings fields so we do not have to keep checking if they exist everywhere SETTINGS.feature = SETTINGS.feature || {}; diff --git a/app/scripts/modules/core/src/confirmationModal/confirmationModal.service.ts b/app/scripts/modules/core/src/confirmationModal/confirmationModal.service.ts index 60104a88452..936f52b6a7e 100644 --- a/app/scripts/modules/core/src/confirmationModal/confirmationModal.service.ts +++ b/app/scripts/modules/core/src/confirmationModal/confirmationModal.service.ts @@ -33,7 +33,7 @@ export class ConfirmationModalService { public constructor(private $uibModal: IModalService, private $sce: ng.ISCEService) {} public confirm(params: IConfirmationModalParams): ng.IPromise { - const extendedParams: IConfirmationModalParams = Object.assign({}, this.defaults, params); + const extendedParams: IConfirmationModalParams = { ...this.defaults, ...params }; if (extendedParams.body) { extendedParams.body = this.$sce.trustAsHtml(extendedParams.body); diff --git a/app/scripts/modules/core/src/domain/IExecutionStage.ts b/app/scripts/modules/core/src/domain/IExecutionStage.ts index 6dea7a71ecd..2066f1a7262 100644 --- a/app/scripts/modules/core/src/domain/IExecutionStage.ts +++ b/app/scripts/modules/core/src/domain/IExecutionStage.ts @@ -69,7 +69,7 @@ export interface IExecutionStageSummary extends IOrchestratedItem { masterStageIndex: number; name: string; refId: number | string; - requisiteStageRefIds: (number | string)[]; + requisiteStageRefIds: Array; stages: IExecutionStage[]; startTime: number; status: string; diff --git a/app/scripts/modules/core/src/domain/IServerGroup.ts b/app/scripts/modules/core/src/domain/IServerGroup.ts index ec23568ecd6..30faccdb996 100644 --- a/app/scripts/modules/core/src/domain/IServerGroup.ts +++ b/app/scripts/modules/core/src/domain/IServerGroup.ts @@ -29,7 +29,7 @@ export interface IServerGroup { detail?: string; disabledDate?: number; entityTags?: IEntityTags; - insightActions?: { url: string; label: string }[]; + insightActions?: Array<{ url: string; label: string }>; instanceCounts: IInstanceCounts; instances: IInstance[]; instanceType?: string; diff --git a/app/scripts/modules/core/src/domain/IStage.ts b/app/scripts/modules/core/src/domain/IStage.ts index 96c49f4eeec..3b40fea9dba 100644 --- a/app/scripts/modules/core/src/domain/IStage.ts +++ b/app/scripts/modules/core/src/domain/IStage.ts @@ -5,6 +5,6 @@ export interface IStage { isNew?: boolean; name: string; refId: string | number; // unfortunately, we kept this loose early on, so it's either a string or a number - requisiteStageRefIds: (string | number)[]; + requisiteStageRefIds: Array; type: string; } diff --git a/app/scripts/modules/core/src/entityTag/EntityTagEditor.tsx b/app/scripts/modules/core/src/entityTag/EntityTagEditor.tsx index 1e57424a7ee..6fd2e17617b 100644 --- a/app/scripts/modules/core/src/entityTag/EntityTagEditor.tsx +++ b/app/scripts/modules/core/src/entityTag/EntityTagEditor.tsx @@ -133,7 +133,7 @@ export class EntityTagEditor extends React.Component application.entityTags.refresh().then(() => onUpdate()), diff --git a/app/scripts/modules/core/src/entityTag/addEntityTagLinks.component.ts b/app/scripts/modules/core/src/entityTag/addEntityTagLinks.component.ts index 24f02dbef89..72755d5401e 100644 --- a/app/scripts/modules/core/src/entityTag/addEntityTagLinks.component.ts +++ b/app/scripts/modules/core/src/entityTag/addEntityTagLinks.component.ts @@ -23,7 +23,7 @@ class AddEntityTagLinksCtrl implements IController { }; const props: IEntityTagEditorProps = { - tag: tag, + tag, isNew: true, owner: this.component, entityType: this.entityType, diff --git a/app/scripts/modules/core/src/entityTag/entityTags.read.service.ts b/app/scripts/modules/core/src/entityTag/entityTags.read.service.ts index 9c276e67dde..0eeeae9d51e 100644 --- a/app/scripts/modules/core/src/entityTag/entityTags.read.service.ts +++ b/app/scripts/modules/core/src/entityTag/entityTags.read.service.ts @@ -80,7 +80,7 @@ export class EntityTagsReader { return this.API.one('tags') .withParams({ entityType: entityType.toLowerCase(), - entityId: entityId, + entityId, }) .getList() .then((entityTagGroups: IEntityTags[]) => { diff --git a/app/scripts/modules/core/src/entityTag/entityTags.write.service.ts b/app/scripts/modules/core/src/entityTag/entityTags.write.service.ts index f2f9a310741..7eae2632b01 100644 --- a/app/scripts/modules/core/src/entityTag/entityTags.write.service.ts +++ b/app/scripts/modules/core/src/entityTag/entityTags.write.service.ts @@ -15,14 +15,14 @@ export class EntityTagWriter { isNew: boolean, ): IPromise { return this.taskExecutor.executeTask({ - application: application, + application, description: `${isNew ? 'Create' : 'Update'} entity tag on ${entityRef.entityId}`, job: [ { type: 'upsertEntityTags', application: application.name, entityId: entityRef.entityId, - entityRef: entityRef, + entityRef, tags: [tag], isPartial: true, }, @@ -32,7 +32,7 @@ export class EntityTagWriter { public deleteEntityTag(application: Application, owner: any, entityTag: IEntityTags, tag: string) { return this.taskExecutor.executeTask({ - application: application, + application, description: `Delete entity tag on ${owner.name}`, job: [ { diff --git a/app/scripts/modules/core/src/entityTag/notifications/NotificationsPopover.tsx b/app/scripts/modules/core/src/entityTag/notifications/NotificationsPopover.tsx index 0f90606efcd..61cf476d3aa 100644 --- a/app/scripts/modules/core/src/entityTag/notifications/NotificationsPopover.tsx +++ b/app/scripts/modules/core/src/entityTag/notifications/NotificationsPopover.tsx @@ -115,15 +115,15 @@ export class NotificationsPopover extends React.Component application.entityTags.refresh().then(() => onUpdate()), }; @@ -149,7 +149,7 @@ export class NotificationsPopover extends React.Component entityTagWriter.deleteEntityTag(application, entity, entityTags, entityTag.name), }); } diff --git a/app/scripts/modules/core/src/filterModel/filter.model.service.ts b/app/scripts/modules/core/src/filterModel/filter.model.service.ts index b271adab939..c32d63802e8 100644 --- a/app/scripts/modules/core/src/filterModel/filter.model.service.ts +++ b/app/scripts/modules/core/src/filterModel/filter.model.service.ts @@ -44,8 +44,8 @@ export class FilterModelService { filters = filters || $location.search(); filterModel.savedState[params.application] = { filters: copy(filters), - state: state, - params: params, + state, + params, }; } }; @@ -237,10 +237,10 @@ export class FilterModelService { forOwn(modelVal, (isActive, value) => { if (isActive) { tags.push({ - key: key, - label: label, + key, + label, value: translator[value] || value, - clear: function() { + clear() { delete (modelVal as any)[value]; model.applyParamsToUrl(); }, @@ -250,10 +250,10 @@ export class FilterModelService { } else { if (modelVal !== null && modelVal !== undefined && modelVal !== '' && modelVal !== false) { tags.push({ - key: key, - label: label, + key, + label, value: translator[modelVal as string] || modelVal, - clear: function() { + clear() { model.sortFilter[key] = clearValue; model.applyParamsToUrl(); }, diff --git a/app/scripts/modules/core/src/forms/numberList/numberList.component.spec.ts b/app/scripts/modules/core/src/forms/numberList/numberList.component.spec.ts index 4fc9774b234..b02ff50821f 100644 --- a/app/scripts/modules/core/src/forms/numberList/numberList.component.spec.ts +++ b/app/scripts/modules/core/src/forms/numberList/numberList.component.spec.ts @@ -23,8 +23,8 @@ describe('Component: numberList', () => { model = startModel; $scope['data'] = { model: startModel, - constraints: constraints, - onChange: onChange, + constraints, + onChange, }; if (stringModel) { $scope['data'].model = stringModel; diff --git a/app/scripts/modules/core/src/forms/numberList/numberList.component.ts b/app/scripts/modules/core/src/forms/numberList/numberList.component.ts index 246771c46d2..f10147ce59c 100644 --- a/app/scripts/modules/core/src/forms/numberList/numberList.component.ts +++ b/app/scripts/modules/core/src/forms/numberList/numberList.component.ts @@ -17,10 +17,10 @@ export class NumberListController implements IController { public synchronize(): void { const model: number[] | string = this.model; // typescript union type woes if (model instanceof Array) { - (model).length = 0; + (model as number[]).length = 0; this.backingModel.forEach(num => { if (num !== null) { - (model).push(num); + (model as number[]).push(num); } }); model.sort((a, b) => a - b); diff --git a/app/scripts/modules/core/src/healthCounts/HealthCounts.tsx b/app/scripts/modules/core/src/healthCounts/HealthCounts.tsx index 13f33629717..bba4e8dc507 100644 --- a/app/scripts/modules/core/src/healthCounts/HealthCounts.tsx +++ b/app/scripts/modules/core/src/healthCounts/HealthCounts.tsx @@ -112,7 +112,7 @@ export class HealthCounts extends React.Component[] = []; + const counts: Array> = []; if (container.up) { counts.push( diff --git a/app/scripts/modules/core/src/history/recentHistory.service.ts b/app/scripts/modules/core/src/history/recentHistory.service.ts index d66c76afa23..58f632cac8f 100644 --- a/app/scripts/modules/core/src/history/recentHistory.service.ts +++ b/app/scripts/modules/core/src/history/recentHistory.service.ts @@ -59,8 +59,8 @@ export class RecentHistoryService { const items: IRecentHistoryEntry[] = this.getItems(type).slice(0, MAX_ITEMS), existing: IRecentHistoryEntry = this.getExisting(items, params, keyParams), entry = { - params: params, - state: state, + params, + state, accessTime: new Date().getTime(), extraData: {}, id: UUIDGenerator.generateUuid(), diff --git a/app/scripts/modules/core/src/insight/insight.module.ts b/app/scripts/modules/core/src/insight/insight.module.ts index 83149205a45..cc19dc15821 100644 --- a/app/scripts/modules/core/src/insight/insight.module.ts +++ b/app/scripts/modules/core/src/insight/insight.module.ts @@ -3,11 +3,11 @@ import { IModule, module } from 'angular'; import { COLLAPSIBLE_SECTION_STATE_CACHE } from 'core/cache/collapsibleSectionStateCache'; import { INSIGHT_LAYOUT_COMPONENT } from './insightLayout.component'; -export const INSIGHT_NGMODULE = module('spinnaker.core.insight', [ +export const INSIGHT_NGMODULE = module('spinnaker.core.insight', [ require('@uirouter/angularjs').default, COLLAPSIBLE_SECTION_STATE_CACHE, INSIGHT_LAYOUT_COMPONENT, -]); +]) as IModule; import './insight.less'; diff --git a/app/scripts/modules/core/src/instance/Instance.tsx b/app/scripts/modules/core/src/instance/Instance.tsx index a7b21459c24..705c9e555ba 100644 --- a/app/scripts/modules/core/src/instance/Instance.tsx +++ b/app/scripts/modules/core/src/instance/Instance.tsx @@ -25,7 +25,7 @@ export class Instance extends React.Component { } public shouldComponentUpdate(nextProps: IInstanceProps) { - const checkProps: (keyof IInstanceProps)[] = ['instance', 'active', 'highlight']; + const checkProps: Array = ['instance', 'active', 'highlight']; return checkProps.some(key => this.props[key] !== nextProps[key]); } diff --git a/app/scripts/modules/core/src/instance/Instances.tsx b/app/scripts/modules/core/src/instance/Instances.tsx index c3f222499c8..cb540c37bbb 100644 --- a/app/scripts/modules/core/src/instance/Instances.tsx +++ b/app/scripts/modules/core/src/instance/Instances.tsx @@ -48,7 +48,7 @@ export class Instances extends React.Component } public shouldComponentUpdate(nextProps: IInstancesProps, nextState: IInstancesState) { - const propsKeys: (keyof IInstancesProps)[] = ['instances', 'highlight']; + const propsKeys: Array = ['instances', 'highlight']; if (propsKeys.some(key => this.props[key] !== nextProps[key])) { return true; } diff --git a/app/scripts/modules/core/src/instance/instance.write.service.ts b/app/scripts/modules/core/src/instance/instance.write.service.ts index 2fa3cf5b808..c9817841038 100644 --- a/app/scripts/modules/core/src/instance/instance.write.service.ts +++ b/app/scripts/modules/core/src/instance/instance.write.service.ts @@ -45,7 +45,7 @@ export class InstanceWriter { return this.taskExecutor.executeTask({ job: [params], - application: application, + application, description: `Terminate instance: ${instance.id}`, }); } @@ -66,7 +66,7 @@ export class InstanceWriter { const descriptor = this.buildMultiInstanceDescriptor(jobs, baseDescriptor, descriptorSuffix); return this.taskExecutor.executeTask({ job: jobs, - application: application, + application, description: descriptor, }); } @@ -86,7 +86,7 @@ export class InstanceWriter { return this.taskExecutor.executeTask({ job: [params], - application: application, + application, description: `Reboot instance: ${instance.id}`, }); } @@ -101,7 +101,7 @@ export class InstanceWriter { const descriptor = this.buildMultiInstanceDescriptor(jobs, 'Deregister', `from ${loadBalancerNames.join(' and ')}`); return this.taskExecutor.executeTask({ job: jobs, - application: application, + application, description: descriptor, }); } @@ -119,7 +119,7 @@ export class InstanceWriter { params.cloudProvider = instance.cloudProvider; return this.taskExecutor.executeTask({ job: [params], - application: application, + application, description: `Deregister instance: ${instance.id}`, }); } @@ -134,7 +134,7 @@ export class InstanceWriter { const descriptor = this.buildMultiInstanceDescriptor(jobs, 'Register', `with ${loadBalancerNames.join(' and ')}`); return this.taskExecutor.executeTask({ job: jobs, - application: application, + application, description: descriptor, }); } @@ -152,7 +152,7 @@ export class InstanceWriter { params.cloudProvider = instance.cloudProvider; return this.taskExecutor.executeTask({ job: [params], - application: application, + application, description: `Register instance: ${instance.id}`, }); } @@ -180,7 +180,7 @@ export class InstanceWriter { asgName: instance.serverGroup, }, ], - application: application, + application, description: `Enable instance: ${instance.id}`, }); } @@ -208,7 +208,7 @@ export class InstanceWriter { asgName: instance.serverGroup, }, ], - application: application, + application, description: `Disable instance: ${instance.id}`, }); } @@ -251,7 +251,7 @@ export class InstanceWriter { return this.taskExecutor.executeTask({ job: [params], - application: application, + application, description: `Terminate instance ${instance.id} and shrink ${instance.serverGroup}`, }); }); @@ -282,7 +282,7 @@ export class InstanceWriter { additionalJobProperties: any = {}, ): IMultiInstanceJob { const job: IMultiInstanceJob = { - type: type, + type, cloudProvider: instanceGroup.cloudProvider, instanceIds: instanceGroup.instanceIds, credentials: instanceGroup.account, diff --git a/app/scripts/modules/core/src/loadBalancer/filter/loadBalancer.filter.service.ts b/app/scripts/modules/core/src/loadBalancer/filter/loadBalancer.filter.service.ts index 54f919c0b39..41f5e8bfd9d 100644 --- a/app/scripts/modules/core/src/loadBalancer/filter/loadBalancer.filter.service.ts +++ b/app/scripts/modules/core/src/loadBalancer/filter/loadBalancer.filter.service.ts @@ -239,7 +239,7 @@ export class LoadBalancerFilterService { subGroup.forEach(loadBalancer => { subSubGroups.push({ heading: loadBalancer.region, - loadBalancer: loadBalancer, + loadBalancer, serverGroups: this.filterServerGroups(loadBalancer), }); }); diff --git a/app/scripts/modules/core/src/loadBalancer/loadBalancer.read.service.ts b/app/scripts/modules/core/src/loadBalancer/loadBalancer.read.service.ts index 1da1c0ece80..252d653ee2a 100644 --- a/app/scripts/modules/core/src/loadBalancer/loadBalancer.read.service.ts +++ b/app/scripts/modules/core/src/loadBalancer/loadBalancer.read.service.ts @@ -6,13 +6,13 @@ import { ILoadBalancer, ILoadBalancerSourceData } from 'core/domain'; export interface ILoadBalancersByAccount { name: string; - accounts: { + accounts: Array<{ name: string; - regions: { + regions: Array<{ name: string; loadBalancers: ILoadBalancerSourceData[]; - }[]; - }[]; + }>; + }>; } export class LoadBalancerReader { diff --git a/app/scripts/modules/core/src/loadBalancer/loadBalancer.write.service.ts b/app/scripts/modules/core/src/loadBalancer/loadBalancer.write.service.ts index b5f968f79ca..66107e50fcc 100644 --- a/app/scripts/modules/core/src/loadBalancer/loadBalancer.write.service.ts +++ b/app/scripts/modules/core/src/loadBalancer/loadBalancer.write.service.ts @@ -40,7 +40,7 @@ export class LoadBalancerWriter { return this.taskExecutor.executeTask({ job: [command], - application: application, + application, description: `Delete load balancer: ${command.loadBalancerName}`, }); } @@ -58,7 +58,7 @@ export class LoadBalancerWriter { return this.taskExecutor.executeTask({ job: [command], - application: application, + application, description: `${descriptor} Load Balancer: ${command['name']}`, }); } diff --git a/app/scripts/modules/core/src/modal/wizard/WizardModal.tsx b/app/scripts/modules/core/src/modal/wizard/WizardModal.tsx index d5215809f67..6edb029a6c8 100644 --- a/app/scripts/modules/core/src/modal/wizard/WizardModal.tsx +++ b/app/scripts/modules/core/src/modal/wizard/WizardModal.tsx @@ -134,7 +134,7 @@ export class WizardModal extends React.Component = []; const newErrorPages: Set = new Set(); this.state.pages.forEach(pageName => { diff --git a/app/scripts/modules/core/src/modal/wizard/v2modalWizard.service.ts b/app/scripts/modules/core/src/modal/wizard/v2modalWizard.service.ts index d98bc30030f..e12c4ba5c74 100644 --- a/app/scripts/modules/core/src/modal/wizard/v2modalWizard.service.ts +++ b/app/scripts/modules/core/src/modal/wizard/v2modalWizard.service.ts @@ -73,7 +73,7 @@ export class V2ModalWizardService { markCompleteOnView: false, required: false, }; - this.pageRegistry.push({ key: key, label: label, state: state }); + this.pageRegistry.push({ key, label, state }); this.renderPages(); } diff --git a/app/scripts/modules/core/src/navigation/urlBuilder.service.ts b/app/scripts/modules/core/src/navigation/urlBuilder.service.ts index cc7805e34e4..47488bcff52 100644 --- a/app/scripts/modules/core/src/navigation/urlBuilder.service.ts +++ b/app/scripts/modules/core/src/navigation/urlBuilder.service.ts @@ -79,7 +79,7 @@ class UrlBuilderUtils { val.forEach((v: any) => { if (isObject(v)) { if (isDate(v)) { - v = (v).toISOString(); + v = (v as Date).toISOString(); } else { v = JSON.stringify(v); } diff --git a/app/scripts/modules/core/src/overrideRegistry/Overridable.tsx b/app/scripts/modules/core/src/overrideRegistry/Overridable.tsx index 954ad038ec5..c186b336214 100644 --- a/app/scripts/modules/core/src/overrideRegistry/Overridable.tsx +++ b/app/scripts/modules/core/src/overrideRegistry/Overridable.tsx @@ -167,7 +167,7 @@ export function overridableComponent

: ; } diff --git a/app/scripts/modules/core/src/pagerDuty/pagerDuty.write.service.ts b/app/scripts/modules/core/src/pagerDuty/pagerDuty.write.service.ts index a9495629a14..45f9f09ba5f 100644 --- a/app/scripts/modules/core/src/pagerDuty/pagerDuty.write.service.ts +++ b/app/scripts/modules/core/src/pagerDuty/pagerDuty.write.service.ts @@ -30,7 +30,7 @@ export class PagerDutyWriter { const job = { type: 'pageApplicationOwner', message: reason, - details: details, + details, } as IJob; if (applications && applications.length > 0) { diff --git a/app/scripts/modules/core/src/pagerDuty/pagerDutyTag.component.spec.ts b/app/scripts/modules/core/src/pagerDuty/pagerDutyTag.component.spec.ts index 02c04e0e2d5..e65fe646548 100644 --- a/app/scripts/modules/core/src/pagerDuty/pagerDutyTag.component.spec.ts +++ b/app/scripts/modules/core/src/pagerDuty/pagerDutyTag.component.spec.ts @@ -36,11 +36,11 @@ describe('PagerDutyTagComponent', () => { ]; const initialize = (apiKey: string) => { - $ctrl = $componentController( + $ctrl = $componentController( 'pagerDutyTag', { $scope: null, pagerDutyReader }, - { apiKey: apiKey }, - ); + { apiKey }, + ) as PagerDutyTagComponentController; $ctrl.$onInit(); }; diff --git a/app/scripts/modules/core/src/pipeline/config/copyStage/copyStage.modal.controller.ts b/app/scripts/modules/core/src/pipeline/config/copyStage/copyStage.modal.controller.ts index bfd79ef6269..d2a9403f7d6 100644 --- a/app/scripts/modules/core/src/pipeline/config/copyStage/copyStage.modal.controller.ts +++ b/app/scripts/modules/core/src/pipeline/config/copyStage/copyStage.modal.controller.ts @@ -86,15 +86,15 @@ class CopyStageModalCtrl implements IController { .one(applicationName) .all(configType) .getList() - .then((configs: (IPipeline | IStrategy)[]) => { + .then((configs: Array) => { const nestedStageWrappers = configs.map(config => { return (config.stages || []) .filter((stage: IStage) => !this.uncopiableStageTypes.has(stage.type)) .map((stage: IStage) => { if (this.isStrategyConfig(config)) { - return { strategy: config.name, stage: stage }; + return { strategy: config.name, stage }; } else { - return { pipeline: config.name, stage: stage }; + return { pipeline: config.name, stage }; } }); }); diff --git a/app/scripts/modules/core/src/pipeline/config/graph/PipelineGraph.tsx b/app/scripts/modules/core/src/pipeline/config/graph/PipelineGraph.tsx index 490f835447a..4e0612a257b 100644 --- a/app/scripts/modules/core/src/pipeline/config/graph/PipelineGraph.tsx +++ b/app/scripts/modules/core/src/pipeline/config/graph/PipelineGraph.tsx @@ -255,9 +255,9 @@ export class PipelineGraph extends React.Component; parentLinks: IPipelineGraphLink[]; parents: IPipelineGraphNode[]; placeholder?: boolean; @@ -77,10 +77,10 @@ export class PipelineGraphService { labelComponent: stage.labelComponent, masterStage: stage.masterStage, name: stage.name, - parentIds: Object.assign([], stage.requisiteStageRefIds || []), + parentIds: { ...[], ...(stage.requisiteStageRefIds || []) }, parentLinks: [], parents: [], - stage: stage, + stage, status: stage.status, }; if (!node.parentIds.length) { @@ -124,12 +124,12 @@ export class PipelineGraphService { isActive: viewState.stageIndex === idx && viewState.section === 'stage', isHighlighted: false, name: stage.name || '[new stage]', - parentIds: Object.assign([], stage.requisiteStageRefIds || []), + parentIds: { ...[], ...(stage.requisiteStageRefIds || []) }, parentLinks: [], parents: [], root: false, section: 'stage', - warnings: warnings, + warnings, }; if (!node.parentIds.length) { node.parentIds.push(configNode.id); diff --git a/app/scripts/modules/core/src/pipeline/config/pipelineConfigProvider.spec.ts b/app/scripts/modules/core/src/pipeline/config/pipelineConfigProvider.spec.ts index 6b77f10ff73..88ce9f95135 100644 --- a/app/scripts/modules/core/src/pipeline/config/pipelineConfigProvider.spec.ts +++ b/app/scripts/modules/core/src/pipeline/config/pipelineConfigProvider.spec.ts @@ -19,20 +19,23 @@ const mockProviderAccount = { authorized: true, }; -const awsProviderAccount = Object.assign({}, mockProviderAccount, { +const awsProviderAccount = { + ...mockProviderAccount, cloudProvider: 'aws', providerVersion: 'foo', -}); +}; -const titusProviderAccount = Object.assign({}, mockProviderAccount, { +const titusProviderAccount = { + ...mockProviderAccount, cloudProvider: 'titus', providerVersion: 'foo', -}); +}; -const gcpProviderAccount = Object.assign({}, mockProviderAccount, { +const gcpProviderAccount = { + ...mockProviderAccount, cloudProvider: 'gcp', providerVersion: 'foo', -}); +}; describe('pipelineConfigProvider: API', function() { let configurer: PipelineConfigProvider, service: PipelineConfigProvider; diff --git a/app/scripts/modules/core/src/pipeline/config/services/pipelineConfig.service.ts b/app/scripts/modules/core/src/pipeline/config/services/pipelineConfig.service.ts index 8626b8dfbe9..aa54f9b22dd 100644 --- a/app/scripts/modules/core/src/pipeline/config/services/pipelineConfig.service.ts +++ b/app/scripts/modules/core/src/pipeline/config/services/pipelineConfig.service.ts @@ -54,7 +54,7 @@ export class PipelineConfigService { const endpoint = isStrategy ? 'strategyConfigs' : 'pipelineConfigs'; return this.API.one(endpoint, id) .all('history') - .withParams({ count: count }) + .withParams({ count }) .getList(); } @@ -105,8 +105,8 @@ export class PipelineConfigService { }); } - public getDownstreamStageIds(pipeline: IPipeline, stage: IStage): (string | number)[] { - let downstream: (string | number)[] = []; + public getDownstreamStageIds(pipeline: IPipeline, stage: IStage): Array { + let downstream: Array = []; const children = pipeline.stages.filter((stageToTest: IStage) => { return stageToTest.requisiteStageRefIds && stageToTest.requisiteStageRefIds.includes(stage.refId); }); @@ -120,7 +120,7 @@ export class PipelineConfigService { } public getDependencyCandidateStages(pipeline: IPipeline, stage: IStage): IStage[] { - const downstreamIds: (string | number)[] = this.getDownstreamStageIds(pipeline, stage); + const downstreamIds: Array = this.getDownstreamStageIds(pipeline, stage); return pipeline.stages.filter((stageToTest: IStage) => { return ( stage !== stageToTest && @@ -159,7 +159,7 @@ export class PipelineConfigService { const sorted = sortBy(pipelines, ['index', 'name']); // if there are pipelines with a bad index, fix that - const toReindex: IPromise[] = []; + const toReindex: Array> = []; if (sorted && sorted.length) { sorted.forEach((pipeline, index) => { if (pipeline.index !== index) { diff --git a/app/scripts/modules/core/src/pipeline/config/stages/cloneServerGroup/CloneServerGroupExecutionDetails.tsx b/app/scripts/modules/core/src/pipeline/config/stages/cloneServerGroup/CloneServerGroupExecutionDetails.tsx index 9f53368477a..a7089ac59fc 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/cloneServerGroup/CloneServerGroupExecutionDetails.tsx +++ b/app/scripts/modules/core/src/pipeline/config/stages/cloneServerGroup/CloneServerGroupExecutionDetails.tsx @@ -55,7 +55,7 @@ export class CloneServerGroupExecutionDetails extends React.Component< application: context.application, serverGroup: serverGroupName, account: context.credentials, - region: region, + region, provider: 'aws', project: ReactInjector.$stateParams.project, }; diff --git a/app/scripts/modules/core/src/pipeline/config/stages/executionWindows/ExecutionWindowActions.tsx b/app/scripts/modules/core/src/pipeline/config/stages/executionWindows/ExecutionWindowActions.tsx index 0f59660b71e..7c8cee32ef8 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/executionWindows/ExecutionWindowActions.tsx +++ b/app/scripts/modules/core/src/pipeline/config/stages/executionWindows/ExecutionWindowActions.tsx @@ -42,7 +42,7 @@ export class ExecutionWindowActions extends React.Component< dayText = this.replaceDays(days).join(', '); } this.state = { - dayText: dayText, + dayText, }; } diff --git a/app/scripts/modules/core/src/pipeline/config/stages/executionWindows/atlasGraph.component.ts b/app/scripts/modules/core/src/pipeline/config/stages/executionWindows/atlasGraph.component.ts index e09d005bcb2..9c101bf7354 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/executionWindows/atlasGraph.component.ts +++ b/app/scripts/modules/core/src/pipeline/config/stages/executionWindows/atlasGraph.component.ts @@ -39,7 +39,7 @@ interface IZoom { } interface IChartOptions { - tooltipHook: { (rows: any[]): any }; + tooltipHook: (rows: any[]) => any; series: IGraphSeries[]; axes: IAxes; zoom: IZoom; diff --git a/app/scripts/modules/core/src/pipeline/config/stages/travis/travisStage.controller.spec.ts b/app/scripts/modules/core/src/pipeline/config/stages/travis/travisStage.controller.spec.ts index 8187ccb80f8..3025afff64b 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/travis/travisStage.controller.spec.ts +++ b/app/scripts/modules/core/src/pipeline/config/stages/travis/travisStage.controller.spec.ts @@ -43,7 +43,7 @@ describe('Travis Stage Controller', () => { $scope.$digest(); expect(controller.jobs).toBeUndefined(); expect(controller.viewState.jobsLoaded).toBe(true); - expect((igorService.listJobsForMaster).calls.count()).toBe(0); + expect((igorService.listJobsForMaster as Spy).calls.count()).toBe(0); }); it('does nothing if job is parameterized', () => { @@ -56,7 +56,7 @@ describe('Travis Stage Controller', () => { $scope.$digest(); expect(controller.jobs).toBeUndefined(); expect(controller.viewState.jobsLoaded).toBe(true); - expect((igorService.listJobsForMaster).calls.count()).toBe(0); + expect((igorService.listJobsForMaster as Spy).calls.count()).toBe(0); }); it('gets jobs from igor and adds them to scope', () => { @@ -100,8 +100,8 @@ describe('Travis Stage Controller', () => { $scope.$digest(); expect(controller.jobs).toBeUndefined(); expect(controller.viewState.jobsLoaded).toBe(true); - expect((igorService.listJobsForMaster).calls.count()).toBe(0); - expect((igorService.getJobConfig).calls.count()).toBe(0); + expect((igorService.listJobsForMaster as Spy).calls.count()).toBe(0); + expect((igorService.getJobConfig as Spy).calls.count()).toBe(0); }); it('does nothing if job is parameterized', () => { @@ -115,8 +115,8 @@ describe('Travis Stage Controller', () => { $scope.$digest(); expect(controller.jobs).toBeUndefined(); expect(controller.viewState.jobsLoaded).toBe(true); - expect((igorService.listJobsForMaster).calls.count()).toBe(0); - expect((igorService.getJobConfig).calls.count()).toBe(0); + expect((igorService.listJobsForMaster as Spy).calls.count()).toBe(0); + expect((igorService.getJobConfig as Spy).calls.count()).toBe(0); }); it('gets job config and adds parameters to scope, setting defaults if present and not overridden', () => { @@ -125,9 +125,9 @@ describe('Travis Stage Controller', () => { { name: 'notSet', defaultValue: 'a' }, { name: 'noDefault', defaultValue: null }, ]; - const jobConfig = { + const jobConfig = { parameterDefinitionList: params, - }; + } as IJobConfig; spyOn(igorService, 'listJobsForMaster').and.returnValue($q.when(['a', 'b'])); spyOn(igorService, 'getJobConfig').and.returnValue($q.when(jobConfig)); const stage = { diff --git a/app/scripts/modules/core/src/pipeline/config/stages/travis/travisStage.ts b/app/scripts/modules/core/src/pipeline/config/stages/travis/travisStage.ts index 616504a95de..02d7f6a754d 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/travis/travisStage.ts +++ b/app/scripts/modules/core/src/pipeline/config/stages/travis/travisStage.ts @@ -112,14 +112,14 @@ export class TravisStage implements IController { const view = this.viewState; if (stage && stage.job && stage.master && !view.masterIsParameterized && !view.jobIsParameterized) { this.igorService.getJobConfig(stage.master, stage.job).then((config: IJobConfig) => { - config = config || {}; + config = config || ({} as IJobConfig); if (!stage.parameters) { stage.parameters = {}; } this.jobParams = config.parameterDefinitionList; this.userSuppliedParameters = stage.parameters; this.useDefaultParameters = {}; - const params = this.jobParams || []; + const params = this.jobParams || ([] as IParameterDefinitionList[]); params.forEach((property: any) => { if (!(property.name in stage.parameters) && property.defaultValue !== null) { this.useDefaultParameters[property.name] = true; diff --git a/app/scripts/modules/core/src/pipeline/config/stages/webhook/webhookStage.ts b/app/scripts/modules/core/src/pipeline/config/stages/webhook/webhookStage.ts index 1602a0ffbdb..6ab60fcd9c7 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/webhook/webhookStage.ts +++ b/app/scripts/modules/core/src/pipeline/config/stages/webhook/webhookStage.ts @@ -156,7 +156,7 @@ module(WEBHOOK_STAGE, [JSON_UTILITY_SERVICE, PIPELINE_CONFIG_PROVIDER, API_SERVI API.one('webhooks') .all('preconfigured') .getList() - .then((preconfiguredWebhooks: Array) => { + .then((preconfiguredWebhooks: IPreconfiguredWebhook[]) => { preconfiguredWebhooks.forEach((preconfiguredWebhook: IPreconfiguredWebhook) => pipelineConfig.registerStage({ label: preconfiguredWebhook.label, diff --git a/app/scripts/modules/core/src/pipeline/config/templates/configurePipelineTemplateModal.controller.ts b/app/scripts/modules/core/src/pipeline/config/templates/configurePipelineTemplateModal.controller.ts index 6717351d294..4d17ad81cad 100644 --- a/app/scripts/modules/core/src/pipeline/config/templates/configurePipelineTemplateModal.controller.ts +++ b/app/scripts/modules/core/src/pipeline/config/templates/configurePipelineTemplateModal.controller.ts @@ -97,7 +97,8 @@ export class ConfigurePipelineTemplateModalController implements IController { } public buildConfig(): IPipelineTemplateConfig { - return Object.assign(this.pipelineTemplateConfig || {}, { + return { + ...(this.pipelineTemplateConfig || {}), type: 'templatedPipeline', name: this.pipelineName, application: this.application.name, @@ -111,7 +112,7 @@ export class ConfigurePipelineTemplateModalController implements IController { variables: this.transformVariablesForPipelinePlan(), }, }, - }); + }; } private loadTemplate(): IPromise { diff --git a/app/scripts/modules/core/src/pipeline/config/templates/pipelineTemplate.service.ts b/app/scripts/modules/core/src/pipeline/config/templates/pipelineTemplate.service.ts index 90c7ea06035..0b592d858a0 100644 --- a/app/scripts/modules/core/src/pipeline/config/templates/pipelineTemplate.service.ts +++ b/app/scripts/modules/core/src/pipeline/config/templates/pipelineTemplate.service.ts @@ -96,7 +96,7 @@ export class PipelineTemplateService { public getPipelinePlan(config: IPipelineTemplateConfig, executionId?: String): IPromise { return this.API.one('pipelines') .one('start') - .post(Object.assign({}, config, { plan: true, executionId })); + .post({ ...config, plan: true, executionId }); } public getPipelineTemplatesByScope(scope: string): IPromise { diff --git a/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTrigger.controller.spec.ts b/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTrigger.controller.spec.ts index 215c665b11b..dd3aaabd43a 100644 --- a/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTrigger.controller.spec.ts +++ b/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTrigger.controller.spec.ts @@ -32,7 +32,7 @@ describe('Controller: travisTrigger', () => { describe('updateJobsList', () => { it('gets list of jobs when initialized with a trigger with a master and sets loading states', () => { const jobs = ['some_job', 'some_other_job'], - trigger = { master: 'travis', job: 'some_job' }; + trigger = { master: 'travis', job: 'some_job' } as IBuildTrigger; spyOn(igorService, 'listJobsForMaster').and.returnValue($q.when(jobs)); spyOn(igorService, 'listMasters').and.returnValue($q.when(['travis'])); @@ -55,10 +55,10 @@ describe('Controller: travisTrigger', () => { name: 'masterB', jobs: ['b', 'c'], }, - trigger = { + trigger = { master: 'masterA', job: 'a', - }; + } as IBuildTrigger; spyOn(igorService, 'listJobsForMaster').and.callFake((master: string) => { return $q.when(find([masterA, masterB], { name: master }).jobs); @@ -90,10 +90,10 @@ describe('Controller: travisTrigger', () => { }); it('retains current job if no jobs found in master because that is probably a server-side issue', () => { - const trigger = { + const trigger = { master: 'masterA', job: 'a', - }; + } as IBuildTrigger; spyOn(igorService, 'listJobsForMaster').and.callFake(() => { return $q.when([]); diff --git a/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTriggerOptions.component.spec.ts b/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTriggerOptions.component.spec.ts index f6741bcc532..daf48f79933 100644 --- a/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTriggerOptions.component.spec.ts +++ b/app/scripts/modules/core/src/pipeline/config/triggers/travis/travisTriggerOptions.component.spec.ts @@ -31,11 +31,11 @@ describe('Travis Trigger: TravisTriggerOptionsCtrl', () => { $q = _$q_; command = { - trigger: { + trigger: { type: 'travis', master: 'a', job: 'b', - }, + } as IBuildTrigger, }; }, ), @@ -45,10 +45,10 @@ describe('Travis Trigger: TravisTriggerOptionsCtrl', () => { const ctrl = $ctrl( TravisTriggerOptionsController, { - igorService: igorService, - $scope: $scope, + igorService, + $scope, }, - { command: command }, + { command }, ); ctrl.$onInit(); return ctrl; @@ -104,9 +104,9 @@ describe('Travis Trigger: TravisTriggerOptionsCtrl', () => { }); it('re-initializes when trigger changes', function() { - const firstBuild: IBuild = { number: '1', result: 'SUCCESS' }, - secondBuild: IBuild = { number: '3', result: 'SUCCESS' }, - secondTrigger: IBuildTrigger = { type: 'travis', master: 'b', job: 'c' }; + const firstBuild: IBuild = { number: '1', result: 'SUCCESS' } as any, + secondBuild: IBuild = { number: '3', result: 'SUCCESS' } as any, + secondTrigger: IBuildTrigger = { type: 'travis', master: 'b', job: 'c' } as IBuildTrigger; spyOn(igorService, 'listBuildsForJob').and.callFake((_master: string, job: string) => { let builds: IBuild[] = []; diff --git a/app/scripts/modules/core/src/pipeline/config/validation/pipelineConfig.validator.spec.ts b/app/scripts/modules/core/src/pipeline/config/validation/pipelineConfig.validator.spec.ts index 9b95a0e2df1..9872b9dc15a 100644 --- a/app/scripts/modules/core/src/pipeline/config/validation/pipelineConfig.validator.spec.ts +++ b/app/scripts/modules/core/src/pipeline/config/validation/pipelineConfig.validator.spec.ts @@ -53,8 +53,8 @@ describe('pipelineConfigValidator', () => { application: 'app', limitConcurrent: true, keepWaitingPipelines: true, - stages: stages, - triggers: triggers, + stages, + triggers, }; } @@ -67,7 +67,7 @@ describe('pipelineConfigValidator', () => { executionDetailsUrl: null, controller: null, controllerAs: null, - validators: validators, + validators, }; } @@ -293,14 +293,14 @@ describe('pipelineConfigValidator', () => { ); validate(); - expect((pipelineConfigService.getPipelinesForApplication).calls.count()).toBe(1); + expect((pipelineConfigService.getPipelinesForApplication as Spy).calls.count()).toBe(1); validate(); - expect((pipelineConfigService.getPipelinesForApplication).calls.count()).toBe(1); + expect((pipelineConfigService.getPipelinesForApplication as Spy).calls.count()).toBe(1); stageOrTriggerBeforeTypeValidator.clearCache(); validate(); - expect((pipelineConfigService.getPipelinesForApplication).calls.count()).toBe(2); + expect((pipelineConfigService.getPipelinesForApplication as Spy).calls.count()).toBe(2); }); it('fails if own stages and parent pipeline triggers do not match', () => { @@ -330,7 +330,7 @@ describe('pipelineConfigValidator', () => { [{ type: 'pipeline', application: 'someApp', pipeline: 'abcd' }], ); validate(); - expect((pipelineConfigService.getPipelinesForApplication).calls.count()).toBe(0); + expect((pipelineConfigService.getPipelinesForApplication as Spy).calls.count()).toBe(0); expect(validationResults.stages.length).toBe(1); }); }); diff --git a/app/scripts/modules/core/src/pipeline/config/validation/pipelineConfig.validator.ts b/app/scripts/modules/core/src/pipeline/config/validation/pipelineConfig.validator.ts index 9dcdee53aae..a42149d5073 100644 --- a/app/scripts/modules/core/src/pipeline/config/validation/pipelineConfig.validator.ts +++ b/app/scripts/modules/core/src/pipeline/config/validation/pipelineConfig.validator.ts @@ -61,7 +61,7 @@ export class PipelineConfigValidator implements IServiceProvider { public validatePipeline(pipeline: IPipeline): IPromise { const stages: IStage[] = pipeline.stages || [], triggers: ITrigger[] = pipeline.triggers || [], - validations: IPromise[] = [], + validations: Array> = [], pipelineValidations: string[] = this.getPipelineLevelValidations(pipeline), stageValidations: Map = new Map(); let preventSave = false; diff --git a/app/scripts/modules/core/src/pipeline/config/validation/stageOrTriggerBeforeType.validator.ts b/app/scripts/modules/core/src/pipeline/config/validation/stageOrTriggerBeforeType.validator.ts index c814e17412e..40fb2435781 100644 --- a/app/scripts/modules/core/src/pipeline/config/validation/stageOrTriggerBeforeType.validator.ts +++ b/app/scripts/modules/core/src/pipeline/config/validation/stageOrTriggerBeforeType.validator.ts @@ -36,7 +36,10 @@ export class StageOrTriggerBeforeTypeValidator implements IStageOrTriggerValidat _config: IStageOrTriggerTypeConfig, ): ng.IPromise { const stageTypes = validator.stageTypes || [validator.stageType]; - const stagesToTest: (IStage | ITrigger)[] = this.pipelineConfigService.getAllUpstreamDependencies(pipeline, stage); + const stagesToTest: Array = this.pipelineConfigService.getAllUpstreamDependencies( + pipeline, + stage, + ); stagesToTest.push(...pipeline.triggers); const parentTriggersToCheck = validator.checkParentTriggers ? this.addPipelineTriggers(pipeline, stagesToTest) : []; @@ -48,7 +51,7 @@ export class StageOrTriggerBeforeTypeValidator implements IStageOrTriggerValidat }); } - private addTriggers(pipelines: IPipeline[], pipelineIdToFind: string, stagesToTest: (IStage | ITrigger)[]): void { + private addTriggers(pipelines: IPipeline[], pipelineIdToFind: string, stagesToTest: Array): void { const match = pipelines.find(p => p.id === pipelineIdToFind); if (match) { stagesToTest.push(...match.triggers); @@ -57,7 +60,7 @@ export class StageOrTriggerBeforeTypeValidator implements IStageOrTriggerValidat private addExternalTriggers( trigger: IPipelineTrigger, - stagesToTest: (IStage | ITrigger)[], + stagesToTest: Array, deferred: ng.IDeferred, ): void { this.pipelineConfigService.getPipelinesForApplication(trigger.application).then(pipelines => { @@ -67,11 +70,11 @@ export class StageOrTriggerBeforeTypeValidator implements IStageOrTriggerValidat }); } - private addPipelineTriggers(pipeline: IPipeline, stagesToTest: (IStage | ITrigger)[]) { + private addPipelineTriggers(pipeline: IPipeline, stagesToTest: Array) { const pipelineTriggers: IPipelineTrigger[] = pipeline.triggers.filter( t => t.type === 'pipeline', ) as IPipelineTrigger[]; - const parentTriggersToCheck: ng.IPromise[] = []; + const parentTriggersToCheck: Array> = []; pipelineTriggers.forEach(trigger => { const deferred: ng.IDeferred = this.$q.defer(); if (this.pipelineCache.has(trigger.application)) { diff --git a/app/scripts/modules/core/src/pipeline/create/CreatePipelineModal.spec.tsx b/app/scripts/modules/core/src/pipeline/create/CreatePipelineModal.spec.tsx index d2958102b9c..c65a19b2cb0 100644 --- a/app/scripts/modules/core/src/pipeline/create/CreatePipelineModal.spec.tsx +++ b/app/scripts/modules/core/src/pipeline/create/CreatePipelineModal.spec.tsx @@ -18,7 +18,7 @@ describe('CreatePipelineModal', () => { let $q: IQService; let $scope: IScope; let application: Application; - let initializeComponent: (configs?: Partial[]) => void; + let initializeComponent: (configs?: Array>) => void; let component: CreatePipelineModal; let pipelineConfigService: PipelineConfigService; let pipelineTemplateService: PipelineTemplateService; @@ -134,7 +134,7 @@ describe('CreatePipelineModal', () => { describe('pipeline name validation', () => { const setPipelineName = (_component: CreatePipelineModal, name: string): void => { - _component.setState({ command: Object.assign({}, _component.state.command, { name }) }); + _component.setState({ command: { ..._component.state.command, name } }); }; it('verifies that the pipeline name does not contain invalid characters', () => { @@ -178,7 +178,7 @@ describe('CreatePipelineModal', () => { return $q.when(null); }); - component.setState({ command: Object.assign({}, component.state.command, { name: 'new pipeline' }) }); + component.setState({ command: { ...component.state.command, name: 'new pipeline' } }); component.submit(); $scope.$digest(); diff --git a/app/scripts/modules/core/src/pipeline/create/CreatePipelineModal.tsx b/app/scripts/modules/core/src/pipeline/create/CreatePipelineModal.tsx index e88edb39e1e..9c29813e338 100644 --- a/app/scripts/modules/core/src/pipeline/create/CreatePipelineModal.tsx +++ b/app/scripts/modules/core/src/pipeline/create/CreatePipelineModal.tsx @@ -28,7 +28,7 @@ export interface ICreatePipelineModalState { loadErrorMessage: string; command: ICreatePipelineCommand; existingNames: string[]; - configs: Partial[]; + configs: Array>; configOptions: Option[]; templates: IPipelineTemplate[]; useTemplate: boolean; @@ -79,7 +79,7 @@ export class CreatePipelineModal extends React.Component[] = [defaultConfig].concat(get(application, 'pipelineConfigs.data', [])); + const configs: Array> = [defaultConfig].concat(get(application, 'pipelineConfigs.data', [])); const configOptions: Option[] = configs.map(config => ({ value: config.name, label: config.name })); const existingNames: string[] = [defaultConfig] .concat(get(application, 'pipelineConfigs.data', [])) @@ -93,10 +93,10 @@ export class CreatePipelineModal extends React.Component): void { - this.setState({ command: Object.assign({}, this.state.command, { name: e.target.value }) }); + this.setState({ command: { ...this.state.command, name: e.target.value } }); } private handleConfigChange(option: Option): void { const config = this.state.configs.find(t => t.name === option.value); - this.setState({ command: Object.assign({}, this.state.command, { config }) }); + this.setState({ command: { ...this.state.command, config } }); } private handleSaveErrorDismiss(): void { @@ -216,7 +216,7 @@ export class CreatePipelineModal extends React.Component void { @@ -229,7 +229,7 @@ export class CreatePipelineModal extends React.Component +

{this.state.duration}
diff --git a/app/scripts/modules/core/src/pipeline/filter/executionFilter.service.ts b/app/scripts/modules/core/src/pipeline/filter/executionFilter.service.ts index 188bf29da4f..5d1840b8e29 100644 --- a/app/scripts/modules/core/src/pipeline/filter/executionFilter.service.ts +++ b/app/scripts/modules/core/src/pipeline/filter/executionFilter.service.ts @@ -160,7 +160,7 @@ export class ExecutionFilterService { configs.filter((config: any) => !groups[config.name]).forEach((config: any) => groups.push({ heading: config.name, - config: config, + config, executions: [], targetAccounts: this.extractAccounts(config), }), @@ -171,7 +171,7 @@ export class ExecutionFilterService { .forEach((config: any) => { groups.push({ heading: config.name, - config: config, + config, executions: [], targetAccounts: this.extractAccounts(config), }); @@ -248,7 +248,7 @@ export class ExecutionFilterService { executions.sort((a, b) => this.executionSorter(a, b)); groups.push({ heading: '', - executions: executions, + executions, runningExecutions: [], }); } diff --git a/app/scripts/modules/core/src/pipeline/service/execution.service.ts b/app/scripts/modules/core/src/pipeline/service/execution.service.ts index e6dedae13e9..e9d86394718 100644 --- a/app/scripts/modules/core/src/pipeline/service/execution.service.ts +++ b/app/scripts/modules/core/src/pipeline/service/execution.service.ts @@ -256,8 +256,8 @@ export class ExecutionService { method: 'PUT', url: [SETTINGS.gateUrl, 'pipelines', executionId, 'cancel'].join('/'), params: { - force: force, - reason: reason, + force, + reason, }, }).then( () => this.waitUntilPipelineIsCancelled(application, executionId).then(deferred.resolve), @@ -335,7 +335,7 @@ export class ExecutionService { public getProjectExecutions(project: string, limit = 1): IPromise { return this.API.one('projects', project) .all('pipelines') - .getList({ limit: limit }) + .getList({ limit }) .then((executions: IExecution[]) => { if (!executions || !executions.length) { return []; @@ -526,14 +526,14 @@ export class ExecutionService { const request = { method: 'PATCH', url: targetUrl, - data: data, + data, timeout: SETTINGS.pollSchedule * 2 + 5000, }; return this.$http(request).then(resp => resp.data); } private stringifyExecution(execution: IExecution): string { - const transient = Object.assign({}, execution); + const transient = { ...execution }; transient.stages = transient.stages.filter(s => s.status !== 'SUCCEEDED' && s.status !== 'NOT_STARTED'); return JSON.stringify(transient, this.jsonReplacer); } diff --git a/app/scripts/modules/core/src/pipeline/service/executions.transformer.service.spec.ts b/app/scripts/modules/core/src/pipeline/service/executions.transformer.service.spec.ts index 5289a5cd7d1..126927e21cc 100644 --- a/app/scripts/modules/core/src/pipeline/service/executions.transformer.service.spec.ts +++ b/app/scripts/modules/core/src/pipeline/service/executions.transformer.service.spec.ts @@ -359,7 +359,7 @@ describe('executionTransformerService', function() { }); it('adds buildInfo from lastBuild if present', () => { - const execution = { stages: [], trigger: { buildInfo: { lastBuild: lastBuild } } } as IExecution; + const execution = { stages: [], trigger: { buildInfo: { lastBuild } } } as IExecution; transformer.transformExecution({} as Application, execution); expect(execution.buildInfo.number).toBe(4); }); diff --git a/app/scripts/modules/core/src/pipeline/status/ArtifactList.spec.tsx b/app/scripts/modules/core/src/pipeline/status/ArtifactList.spec.tsx index 87887d119bb..e09742f8b48 100644 --- a/app/scripts/modules/core/src/pipeline/status/ArtifactList.spec.tsx +++ b/app/scripts/modules/core/src/pipeline/status/ArtifactList.spec.tsx @@ -66,7 +66,7 @@ describe('', () => { id: 'abcd', type: ARTIFACT_TYPE, name: ARTIFACT_NAME, - version: version, + version, }, ]; component = shallow(); diff --git a/app/scripts/modules/core/src/pipeline/status/ExecutionStatus.tsx b/app/scripts/modules/core/src/pipeline/status/ExecutionStatus.tsx index c1cf5956a44..9c350316657 100644 --- a/app/scripts/modules/core/src/pipeline/status/ExecutionStatus.tsx +++ b/app/scripts/modules/core/src/pipeline/status/ExecutionStatus.tsx @@ -24,7 +24,7 @@ export interface IExecutionStatusProps { export interface IExecutionStatusState { sortFilter: ISortFilter; - parameters: { key: string; value: any }[]; + parameters: Array<{ key: string; value: any }>; timestamp: string; } @@ -38,7 +38,7 @@ export class ExecutionStatus extends React.Component = []; const { execution } = this.props; if (execution.trigger && execution.trigger.parameters) { diff --git a/app/scripts/modules/core/src/presentation/HoverablePopover.tsx b/app/scripts/modules/core/src/presentation/HoverablePopover.tsx index 5bd4f5413d5..9aee95037fe 100644 --- a/app/scripts/modules/core/src/presentation/HoverablePopover.tsx +++ b/app/scripts/modules/core/src/presentation/HoverablePopover.tsx @@ -207,7 +207,7 @@ class PopoverOffset extends React.Component; } else { return ; diff --git a/app/scripts/modules/core/src/presentation/ReactModal.tsx b/app/scripts/modules/core/src/presentation/ReactModal.tsx index fcd2983cdbc..1dd9234a6a8 100644 --- a/app/scripts/modules/core/src/presentation/ReactModal.tsx +++ b/app/scripts/modules/core/src/presentation/ReactModal.tsx @@ -37,7 +37,7 @@ export class ReactModal { ModalComponent: React.ComponentType

, props?: P, ): Promise { - const modalPropKeys: (keyof ModalProps)[] = [ + const modalPropKeys: Array = [ 'onHide', 'animation', 'autoFocus', diff --git a/app/scripts/modules/core/src/presentation/anyFieldFilter/anyField.filter.ts b/app/scripts/modules/core/src/presentation/anyFieldFilter/anyField.filter.ts index 675c7d2a6d7..3b745241232 100644 --- a/app/scripts/modules/core/src/presentation/anyFieldFilter/anyField.filter.ts +++ b/app/scripts/modules/core/src/presentation/anyFieldFilter/anyField.filter.ts @@ -20,7 +20,7 @@ export function anyFieldFilter() { const keys: any[] = Object.keys(props); for (const prop of keys) { - const text: string = (props)[prop].toLowerCase(); + const text: string = (props as any)[prop].toLowerCase(); if ( item[prop] && item[prop] diff --git a/app/scripts/modules/core/src/presentation/autoScroll/autoScroll.directive.ts b/app/scripts/modules/core/src/presentation/autoScroll/autoScroll.directive.ts index afbc5c3e11e..493b7df7acc 100644 --- a/app/scripts/modules/core/src/presentation/autoScroll/autoScroll.directive.ts +++ b/app/scripts/modules/core/src/presentation/autoScroll/autoScroll.directive.ts @@ -78,4 +78,4 @@ class AutoScrollDirective implements IDirective { export const AUTO_SCROLL_DIRECTIVE = 'spinnaker.core.autoScroll'; -module(AUTO_SCROLL_DIRECTIVE, []).directive('autoScroll', AutoScrollDirective); +module(AUTO_SCROLL_DIRECTIVE, []).directive('autoScroll', AutoScrollDirective as any); diff --git a/app/scripts/modules/core/src/scheduler/scheduler.factory.ts b/app/scripts/modules/core/src/scheduler/scheduler.factory.ts index 86ddd6a596b..fd91229ccbf 100644 --- a/app/scripts/modules/core/src/scheduler/scheduler.factory.ts +++ b/app/scripts/modules/core/src/scheduler/scheduler.factory.ts @@ -81,7 +81,7 @@ export class SchedulerFactory { return { subscribe: scheduler.subscribe.bind(scheduler), - scheduleImmediate: scheduleImmediate, + scheduleImmediate, unsubscribe: () => { suspended = true; if (scheduler) { diff --git a/app/scripts/modules/core/src/search/infrastructure/RecentlyViewedItems.tsx b/app/scripts/modules/core/src/search/infrastructure/RecentlyViewedItems.tsx index 361a9e3fccb..d13d89feb6f 100644 --- a/app/scripts/modules/core/src/search/infrastructure/RecentlyViewedItems.tsx +++ b/app/scripts/modules/core/src/search/infrastructure/RecentlyViewedItems.tsx @@ -72,7 +72,7 @@ export class RecentlyViewedItems extends React.Component { - const routeParams = Object.assign({}, item.params, item.extraData); + const routeParams = { ...item.params, ...item.extraData }; return this.search.formatRouteResult(category, routeParams).then(displayName => ({ ...item, displayName })); } diff --git a/app/scripts/modules/core/src/search/infrastructure/SearchV2.tsx b/app/scripts/modules/core/src/search/infrastructure/SearchV2.tsx index 2c919565cb2..da186471c4d 100644 --- a/app/scripts/modules/core/src/search/infrastructure/SearchV2.tsx +++ b/app/scripts/modules/core/src/search/infrastructure/SearchV2.tsx @@ -83,7 +83,7 @@ export class SearchV2 extends React.Component<{}, ISearchV2State> { // Start fetching results for each search type from the search service. // Update the overall results with the results for each search type. return this.infrastructureSearchServiceV2 - .search(Object.assign({}, params)) + .search({ ...params }) .scan((acc: ISearchResultSet[], resultSet: ISearchResultSet): ISearchResultSet[] => { const status = resultSet.status === SearchStatus.SEARCHING ? SearchStatus.FINISHED : resultSet.status; resultSet = { ...resultSet, status }; diff --git a/app/scripts/modules/core/src/search/search.service.ts b/app/scripts/modules/core/src/search/search.service.ts index d9f422e38db..eb3c6699344 100644 --- a/app/scripts/modules/core/src/search/search.service.ts +++ b/app/scripts/modules/core/src/search/search.service.ts @@ -48,7 +48,7 @@ export class SearchService { pageSize: SearchService.DEFAULT_PAGE_SIZE, }; - const params = Object.assign(searchParams, defaultParams); + const params = { ...searchParams, ...defaultParams }; const requestBuilder = this.API.one('search').withParams(params); @@ -58,7 +58,7 @@ export class SearchService { return requestBuilder .get() - .then((response: ISearchResults[]) => { + .then((response: Array>) => { return response[0] || getFallbackResults(); }) .catch((response: IHttpPromiseCallbackArg) => { diff --git a/app/scripts/modules/core/src/securityGroup/filter/securityGroupFilter.service.ts b/app/scripts/modules/core/src/securityGroup/filter/securityGroupFilter.service.ts index 944ae1a7887..9470098e12f 100644 --- a/app/scripts/modules/core/src/securityGroup/filter/securityGroupFilter.service.ts +++ b/app/scripts/modules/core/src/securityGroup/filter/securityGroupFilter.service.ts @@ -134,9 +134,9 @@ export class SecurityGroupFilterService { ? `${securityGroup.region} (${securityGroup.vpcName})` : securityGroup.region; subSubGroups.push({ - heading: heading, + heading, vpcName: securityGroup.vpcName, - securityGroup: securityGroup, + securityGroup, }); }); subGroups.push({ diff --git a/app/scripts/modules/core/src/securityGroup/securityGroupReader.service.ts b/app/scripts/modules/core/src/securityGroup/securityGroupReader.service.ts index 27dfe46a992..636d7b163e9 100644 --- a/app/scripts/modules/core/src/securityGroup/securityGroupReader.service.ts +++ b/app/scripts/modules/core/src/securityGroup/securityGroupReader.service.ts @@ -37,10 +37,10 @@ export interface IReaderSecurityGroup extends ISecurityGroup { } export interface IRangeRule { - portRanges: { + portRanges: Array<{ startPort: number; endPort: number; - }[]; + }>; protocol: string; } diff --git a/app/scripts/modules/core/src/securityGroup/securityGroupWriter.service.ts b/app/scripts/modules/core/src/securityGroup/securityGroupWriter.service.ts index fe01f723285..d1f3a9e6674 100644 --- a/app/scripts/modules/core/src/securityGroup/securityGroupWriter.service.ts +++ b/app/scripts/modules/core/src/securityGroup/securityGroupWriter.service.ts @@ -28,7 +28,7 @@ export class SecurityGroupWriter { const operation: IPromise = this.taskExecutor.executeTask({ job: [params], - application: application, + application, description: `Delete Security Group: ${securityGroup.name}`, }); this.infrastructureCaches.clearCache('securityGroups'); @@ -44,11 +44,11 @@ export class SecurityGroupWriter { ): IPromise { params.type = 'upsertSecurityGroup'; params.credentials = securityGroup.credentials || securityGroup.accountName; - const job: ISecurityGroupJob = Object.assign(securityGroup, params); + const job: ISecurityGroupJob = { ...securityGroup, ...params }; const operation: IPromise = this.taskExecutor.executeTask({ job: [job], - application: application, + application, description: `${description} Security Group: ${securityGroup.name}`, }); diff --git a/app/scripts/modules/core/src/serverGroup/configure/common/deployInitializer.component.spec.ts b/app/scripts/modules/core/src/serverGroup/configure/common/deployInitializer.component.spec.ts index 78f58904f50..6c471e78ebf 100644 --- a/app/scripts/modules/core/src/serverGroup/configure/common/deployInitializer.component.spec.ts +++ b/app/scripts/modules/core/src/serverGroup/configure/common/deployInitializer.component.spec.ts @@ -12,11 +12,11 @@ describe('Component: deployInitializer', () => { application: Application; const initialize = () => { - ctrl = $componentController( + ctrl = $componentController( 'deployInitializer', {}, { application, command: { viewState: {} }, cloudProvider: 'aws' }, - ); + ) as DeployInitializerController; ctrl.$onInit(); }; diff --git a/app/scripts/modules/core/src/serverGroup/details/ServerGroupDetailsWrapper.tsx b/app/scripts/modules/core/src/serverGroup/details/ServerGroupDetailsWrapper.tsx index f168b7f21e3..64e050dd1da 100644 --- a/app/scripts/modules/core/src/serverGroup/details/ServerGroupDetailsWrapper.tsx +++ b/app/scripts/modules/core/src/serverGroup/details/ServerGroupDetailsWrapper.tsx @@ -33,7 +33,7 @@ export interface IServerGroupDetailsWrapperState { controller: string; }; detailsGetter: DetailsGetter; - sections: React.ComponentType[]; + sections: Array>; Actions: React.ComponentType; } @@ -50,7 +50,7 @@ export interface IServerGroupDetailsSectionProps { export interface IServerGroupDetailsProps extends IServerGroupDetailsWrapperProps { Actions: React.ComponentType; detailsGetter: DetailsGetter; - sections: React.ComponentType[]; + sections: Array>; } export interface IServerGroupDetailsState { @@ -93,7 +93,7 @@ export class ServerGroupDetailsWrapper extends React.Component< values: [ React.ComponentClass, DetailsGetter, - React.ComponentType[], + Array>, string, string ], diff --git a/app/scripts/modules/core/src/serverGroup/details/scalingActivities/scalingActivities.controller.spec.ts b/app/scripts/modules/core/src/serverGroup/details/scalingActivities/scalingActivities.controller.spec.ts index 00f9389dcf4..b8a2e66b881 100644 --- a/app/scripts/modules/core/src/serverGroup/details/scalingActivities/scalingActivities.controller.spec.ts +++ b/app/scripts/modules/core/src/serverGroup/details/scalingActivities/scalingActivities.controller.spec.ts @@ -30,7 +30,7 @@ describe('Controller: ScalingActivitiesCtrl', () => { spyOn(serverGroupReader, 'getScalingActivities').and.callFake(() => $q.when(activities)); ctrl = $controller('ScalingActivitiesCtrl', { - serverGroupReader: serverGroupReader, + serverGroupReader, serverGroup: { name: 'asg-v001', region: 'us-east-1', diff --git a/app/scripts/modules/core/src/serverGroup/details/scalingActivities/scalingActivities.controller.ts b/app/scripts/modules/core/src/serverGroup/details/scalingActivities/scalingActivities.controller.ts index c170a47433d..d153f26381e 100644 --- a/app/scripts/modules/core/src/serverGroup/details/scalingActivities/scalingActivities.controller.ts +++ b/app/scripts/modules/core/src/serverGroup/details/scalingActivities/scalingActivities.controller.ts @@ -58,11 +58,11 @@ export class ScalingActivitiesCtrl implements IController { } catch (e) { // I don't imagine this would happen but let's not blow up the world if it does. } - events.push({ description: entry.description, availabilityZone: availabilityZone }); + events.push({ description: entry.description, availabilityZone }); }); results.push({ cause: group[0].cause, - events: events, + events, startTime: group[0].startTime, statusCode: group[0].statusCode, isSuccessful: group[0].statusCode === 'Successful', diff --git a/app/scripts/modules/core/src/serverGroup/serverGroupWriter.service.spec.ts b/app/scripts/modules/core/src/serverGroup/serverGroupWriter.service.spec.ts index 6aadc0d5381..785720b68d1 100644 --- a/app/scripts/modules/core/src/serverGroup/serverGroupWriter.service.spec.ts +++ b/app/scripts/modules/core/src/serverGroup/serverGroupWriter.service.spec.ts @@ -70,15 +70,15 @@ describe('serverGroupWriter', function() { let submitted: ITaskCommand = {}; $httpBackend .expectPOST(`${API.baseUrl}/applications/app/tasks`, (body: string) => { - submitted = JSON.parse(body); + submitted = JSON.parse(body) as ITaskCommand; return true; }) .respond(200, { ref: '/1' }); - const application: TestApplication = applicationModelBuilder.createApplication( + const application: TestApplication = applicationModelBuilder.createApplication( 'app', applicationDataSourceRegistry.getDataSources(), - ); + ) as TestApplication; application.tasks = { refresh: noop, }; diff --git a/app/scripts/modules/core/src/task/monitor/taskMonitor.builder.spec.ts b/app/scripts/modules/core/src/task/monitor/taskMonitor.builder.spec.ts index 2a7879be18d..3bd16bba93c 100644 --- a/app/scripts/modules/core/src/task/monitor/taskMonitor.builder.spec.ts +++ b/app/scripts/modules/core/src/task/monitor/taskMonitor.builder.spec.ts @@ -62,7 +62,7 @@ describe('Service: taskMonitorBuilder', () => { $timeout.flush(); $http.flush(); expect(monitor.task.isCompleted).toBe(false); - expect((monitor.application.getDataSource('runningTasks').refresh).calls.count()).toBe(1); + expect((monitor.application.getDataSource('runningTasks').refresh as Spy).calls.count()).toBe(1); $http.expectGET([API.baseUrl, 'tasks', 'a'].join('/')).respond(200, { status: 'SUCCEEDED' }); $timeout.flush(); // complete second time diff --git a/app/scripts/modules/core/src/utils/json/json.utility.service.ts b/app/scripts/modules/core/src/utils/json/json.utility.service.ts index 94d6d74ca24..c6dc97db980 100644 --- a/app/scripts/modules/core/src/utils/json/json.utility.service.ts +++ b/app/scripts/modules/core/src/utils/json/json.utility.service.ts @@ -104,17 +104,17 @@ export class JsonUtilityService { if (diff[0] === 1) { type = 'add'; additions += lines.length; - changeBlocks.push({ type: type, lines: lines.length, start: total, height: null, top: null }); + changeBlocks.push({ type, lines: lines.length, start: total, height: null, top: null }); } if (diff[0] === -1) { type = 'remove'; removals += lines.length; - changeBlocks.push({ type: type, lines: lines.length, start: total, height: null, top: null }); + changeBlocks.push({ type, lines: lines.length, start: total, height: null, top: null }); } if (diff[0] === 0) { unchanged += lines.length; } - lines.forEach((l: string) => diffLines.push({ type: type, text: l })); + lines.forEach((l: string) => diffLines.push({ type, text: l })); total += lines.length; }); changeBlocks.forEach(b => { diff --git a/app/scripts/modules/core/src/utils/selectOnDblClick.directive.ts b/app/scripts/modules/core/src/utils/selectOnDblClick.directive.ts index aeaf83d05cc..210a595c620 100644 --- a/app/scripts/modules/core/src/utils/selectOnDblClick.directive.ts +++ b/app/scripts/modules/core/src/utils/selectOnDblClick.directive.ts @@ -37,4 +37,4 @@ class DoubleClickDirective implements IDirective { } export const SELECT_ON_DOUBLE_CLICK_DIRECTIVE = 'spinnaker.core.utils.selectOnDblClick'; -module(SELECT_ON_DOUBLE_CLICK_DIRECTIVE, []).directive('selectOnDblClick', DoubleClickDirective); +module(SELECT_ON_DOUBLE_CLICK_DIRECTIVE, []).directive('selectOnDblClick', DoubleClickDirective as any); diff --git a/app/scripts/modules/core/src/widgets/spinners/Spinner.tsx b/app/scripts/modules/core/src/widgets/spinners/Spinner.tsx index 13657684459..d358eee37af 100644 --- a/app/scripts/modules/core/src/widgets/spinners/Spinner.tsx +++ b/app/scripts/modules/core/src/widgets/spinners/Spinner.tsx @@ -8,7 +8,7 @@ export interface ISpinnerProps { @BindAll() export class Spinner extends React.Component { - public getBarRows(): Array { + public getBarRows(): React.ReactNode[] { const { size } = this.props; let count = 3; diff --git a/app/scripts/modules/dcos/dcos.settings.ts b/app/scripts/modules/dcos/dcos.settings.ts index a4722163f83..01daf139ba3 100644 --- a/app/scripts/modules/dcos/dcos.settings.ts +++ b/app/scripts/modules/dcos/dcos.settings.ts @@ -7,7 +7,7 @@ export interface IDcosProviderSettings extends IProviderSettings { }; } -export const DcosProviderSettings: IDcosProviderSettings = SETTINGS.providers.dcos || { +export const DcosProviderSettings: IDcosProviderSettings = (SETTINGS.providers.dcos as IDcosProviderSettings) || { defaults: {}, }; if (DcosProviderSettings) { diff --git a/app/scripts/modules/docker/src/image/dockerImageAndTagSelector.component.spec.ts b/app/scripts/modules/docker/src/image/dockerImageAndTagSelector.component.spec.ts index 003d9d7f0b8..723106beac1 100644 --- a/app/scripts/modules/docker/src/image/dockerImageAndTagSelector.component.spec.ts +++ b/app/scripts/modules/docker/src/image/dockerImageAndTagSelector.component.spec.ts @@ -44,11 +44,11 @@ describe('dockerImageAndTagSelector controller', () => { const initialize = (accounts: IAccount[], images: IDockerImage[]) => { spyOn(accountService, 'listAccounts').and.returnValue($q.when(accounts)); spyOn(dockerImageReader, 'findImages').and.returnValue($q.when(images)); - $ctrl = $componentController( + $ctrl = $componentController( 'dockerImageAndTagSelector', { accountService, dockerImageReader }, { organization, registry, repository, tag, account, showRegistry }, - ); + ) as DockerImageAndTagSelectorController; $ctrl.$onInit(); $scope.$digest(); }; diff --git a/app/scripts/modules/ecs/ecs.settings.ts b/app/scripts/modules/ecs/ecs.settings.ts index 0af3140be20..a2c26eb499d 100644 --- a/app/scripts/modules/ecs/ecs.settings.ts +++ b/app/scripts/modules/ecs/ecs.settings.ts @@ -8,7 +8,7 @@ export interface IECSProviderSettings extends IProviderSettings { }; } -export const IECSProviderSettings: IECSProviderSettings = SETTINGS.providers.ecs || { +export const IECSProviderSettings: IECSProviderSettings = (SETTINGS.providers.ecs as IECSProviderSettings) || { defaults: {}, }; if (IECSProviderSettings) { diff --git a/app/scripts/modules/ecs/serverGroup/serverGroup.transformer.ts b/app/scripts/modules/ecs/serverGroup/serverGroup.transformer.ts index 1a4fe9f54d0..355c1c199a2 100644 --- a/app/scripts/modules/ecs/serverGroup/serverGroup.transformer.ts +++ b/app/scripts/modules/ecs/serverGroup/serverGroup.transformer.ts @@ -46,7 +46,7 @@ export class EcsServerGroupTransformer { } private transformScalingPolicy(policy: IScalingPolicy): IScalingPolicyView { - const view: IScalingPolicyView = Object.assign({}, policy) as IScalingPolicyView; + const view: IScalingPolicyView = { ...policy } as IScalingPolicyView; const upperBoundSorter = (a: IStepAdjustmentView, b: IStepAdjustmentView) => b.metricIntervalUpperBound - a.metricIntervalUpperBound, lowerBoundSorter = (a: IStepAdjustmentView, b: IStepAdjustmentView) => @@ -66,7 +66,7 @@ export class EcsServerGroupTransformer { } public normalizeServerGroupDetails(serverGroup: IAmazonServerGroup): IAmazonServerGroupView { - const view: IAmazonServerGroupView = Object.assign({}, serverGroup) as IAmazonServerGroupView; + const view: IAmazonServerGroupView = { ...serverGroup } as IAmazonServerGroupView; if (serverGroup.scalingPolicies) { view.scalingPolicies = serverGroup.scalingPolicies.map(policy => this.transformScalingPolicy(policy)); } diff --git a/app/scripts/modules/google/src/gce.settings.ts b/app/scripts/modules/google/src/gce.settings.ts index 8a4a61e0174..fb30e9cb92f 100644 --- a/app/scripts/modules/google/src/gce.settings.ts +++ b/app/scripts/modules/google/src/gce.settings.ts @@ -8,7 +8,7 @@ export interface IGCEProviderSettings extends IProviderSettings { }; } -export const GCEProviderSettings: IGCEProviderSettings = SETTINGS.providers.gce || { +export const GCEProviderSettings: IGCEProviderSettings = (SETTINGS.providers.gce as IGCEProviderSettings) || { defaults: {}, }; if (GCEProviderSettings) { diff --git a/app/scripts/modules/google/src/loadBalancer/details/deleteModal/deleteModal.controller.ts b/app/scripts/modules/google/src/loadBalancer/details/deleteModal/deleteModal.controller.ts index 2db9f24e1fb..de3049c0204 100644 --- a/app/scripts/modules/google/src/loadBalancer/details/deleteModal/deleteModal.controller.ts +++ b/app/scripts/modules/google/src/loadBalancer/details/deleteModal/deleteModal.controller.ts @@ -77,7 +77,7 @@ class DeleteLoadBalancerModalController implements IController { } } - private getSubmitMethod(): { (): IPromise } { + private getSubmitMethod(): () => IPromise { if (this.gceHttpLoadBalancerUtils.isHttpLoadBalancer(this.loadBalancer)) { return () => { return this.gceHttpLoadBalancerWriter.deleteLoadBalancers(this.loadBalancer, this.application, this.params); diff --git a/app/scripts/modules/kubernetes/src/kubernetes.settings.ts b/app/scripts/modules/kubernetes/src/kubernetes.settings.ts index 7fc6997e159..263952b44cd 100644 --- a/app/scripts/modules/kubernetes/src/kubernetes.settings.ts +++ b/app/scripts/modules/kubernetes/src/kubernetes.settings.ts @@ -12,8 +12,8 @@ export interface IKubernetesProviderSettings extends IProviderSettings { }; } -export const KubernetesProviderSettings: IKubernetesProviderSettings = SETTINGS.providers - .kubernetes || { defaults: {} }; +export const KubernetesProviderSettings: IKubernetesProviderSettings = (SETTINGS.providers + .kubernetes as IKubernetesProviderSettings) || { defaults: {} }; if (KubernetesProviderSettings) { KubernetesProviderSettings.resetToOriginal = SETTINGS.resetProvider('kubernetes'); } diff --git a/app/scripts/modules/kubernetes/src/v2/manifest/delete/delete.controller.ts b/app/scripts/modules/kubernetes/src/v2/manifest/delete/delete.controller.ts index cbef077a9cf..cdad6e342f1 100644 --- a/app/scripts/modules/kubernetes/src/v2/manifest/delete/delete.controller.ts +++ b/app/scripts/modules/kubernetes/src/v2/manifest/delete/delete.controller.ts @@ -44,7 +44,7 @@ class KubernetesManifestDeleteController implements IController { this.taskMonitor = taskMonitorBuilder.buildTaskMonitor({ title: `Deleting ${coordinates.name} in ${coordinates.namespace}`, - application: application, + application, modalInstance: $uibModalInstance, }); diff --git a/app/scripts/modules/kubernetes/src/v2/manifest/rollout/pause.controller.ts b/app/scripts/modules/kubernetes/src/v2/manifest/rollout/pause.controller.ts index f78079f82c0..d4b6dfa8b3f 100644 --- a/app/scripts/modules/kubernetes/src/v2/manifest/rollout/pause.controller.ts +++ b/app/scripts/modules/kubernetes/src/v2/manifest/rollout/pause.controller.ts @@ -36,7 +36,7 @@ class KubernetesManifestPauseRolloutController implements IController { this.taskMonitor = taskMonitorBuilder.buildTaskMonitor({ title: `Pause rollout of ${coordinates.name} in ${coordinates.namespace}`, - application: application, + application, modalInstance: $uibModalInstance, }); diff --git a/app/scripts/modules/kubernetes/src/v2/manifest/rollout/resume.controller.ts b/app/scripts/modules/kubernetes/src/v2/manifest/rollout/resume.controller.ts index 9a2e85403a0..47876ec3d84 100644 --- a/app/scripts/modules/kubernetes/src/v2/manifest/rollout/resume.controller.ts +++ b/app/scripts/modules/kubernetes/src/v2/manifest/rollout/resume.controller.ts @@ -36,7 +36,7 @@ class KubernetesManifestResumeRolloutController implements IController { this.taskMonitor = taskMonitorBuilder.buildTaskMonitor({ title: `Resume rollout of ${coordinates.name} in ${coordinates.namespace}`, - application: application, + application, modalInstance: $uibModalInstance, }); diff --git a/app/scripts/modules/kubernetes/src/v2/manifest/rollout/undo.controller.ts b/app/scripts/modules/kubernetes/src/v2/manifest/rollout/undo.controller.ts index 52bbb6bb96c..d76b624d7ad 100644 --- a/app/scripts/modules/kubernetes/src/v2/manifest/rollout/undo.controller.ts +++ b/app/scripts/modules/kubernetes/src/v2/manifest/rollout/undo.controller.ts @@ -43,7 +43,7 @@ class KubernetesManifestUndoRolloutController implements IController { this.taskMonitor = taskMonitorBuilder.buildTaskMonitor({ title: `Undo rollout of ${coordinates.name} in ${coordinates.namespace}`, - application: application, + application, modalInstance: $uibModalInstance, }); diff --git a/app/scripts/modules/kubernetes/src/v2/manifest/scale/scale.controller.ts b/app/scripts/modules/kubernetes/src/v2/manifest/scale/scale.controller.ts index e066575314d..d76fad5e5c3 100644 --- a/app/scripts/modules/kubernetes/src/v2/manifest/scale/scale.controller.ts +++ b/app/scripts/modules/kubernetes/src/v2/manifest/scale/scale.controller.ts @@ -39,7 +39,7 @@ class KubernetesManifestScaleController implements IController { this.taskMonitor = taskMonitorBuilder.buildTaskMonitor({ title: `Scaling ${coordinates.name} in ${coordinates.namespace}`, - application: application, + application, modalInstance: $uibModalInstance, }); diff --git a/app/scripts/modules/kubernetes/src/v2/manifest/showManifestYaml.component.ts b/app/scripts/modules/kubernetes/src/v2/manifest/showManifestYaml.component.ts index 225f15058d0..716f91ea61f 100644 --- a/app/scripts/modules/kubernetes/src/v2/manifest/showManifestYaml.component.ts +++ b/app/scripts/modules/kubernetes/src/v2/manifest/showManifestYaml.component.ts @@ -21,7 +21,7 @@ class KubernetesShowManifestYaml implements IController { scope.manifestData = this.text; this.$uibModal.open({ templateUrl: require('./showManifestYaml.html'), - scope: scope, + scope, }); } } diff --git a/app/scripts/modules/kubernetes/src/v2/serverGroup/details/resize/resize.controller.ts b/app/scripts/modules/kubernetes/src/v2/serverGroup/details/resize/resize.controller.ts index a78128d2419..ee3a29efb9a 100644 --- a/app/scripts/modules/kubernetes/src/v2/serverGroup/details/resize/resize.controller.ts +++ b/app/scripts/modules/kubernetes/src/v2/serverGroup/details/resize/resize.controller.ts @@ -35,7 +35,7 @@ class KubernetesServerGroupResizeController implements IController { 'ngInject'; this.taskMonitor = taskMonitorBuilder.buildTaskMonitor({ title: `Resizing ${this.serverGroup.name}`, - application: application, + application, modalInstance: $uibModalInstance, }); diff --git a/app/scripts/modules/openstack/src/openstack.settings.ts b/app/scripts/modules/openstack/src/openstack.settings.ts index 541b13b40ee..05f8553d9de 100644 --- a/app/scripts/modules/openstack/src/openstack.settings.ts +++ b/app/scripts/modules/openstack/src/openstack.settings.ts @@ -7,8 +7,8 @@ export interface IOpenStackProviderSettings extends IProviderSettings { }; } -export const OpenStackProviderSettings: IOpenStackProviderSettings = SETTINGS.providers - .openstack || { defaults: {} }; +export const OpenStackProviderSettings: IOpenStackProviderSettings = (SETTINGS.providers + .openstack as IOpenStackProviderSettings) || { defaults: {} }; if (OpenStackProviderSettings) { OpenStackProviderSettings.resetToOriginal = SETTINGS.resetProvider('openstack'); } diff --git a/app/scripts/modules/oracle/oraclebmcs.settings.ts b/app/scripts/modules/oracle/oraclebmcs.settings.ts index 8e68ff62703..bdc7a8ee673 100644 --- a/app/scripts/modules/oracle/oraclebmcs.settings.ts +++ b/app/scripts/modules/oracle/oraclebmcs.settings.ts @@ -7,8 +7,8 @@ export interface IOracleBMCSProviderSettings extends IProviderSettings { }; } -export const OracleBMCSProviderSettings: IOracleBMCSProviderSettings = SETTINGS.providers - .oraclebmcs || { defaults: {} }; +export const OracleBMCSProviderSettings: IOracleBMCSProviderSettings = (SETTINGS.providers + .oraclebmcs as IOracleBMCSProviderSettings) || { defaults: {} }; if (OracleBMCSProviderSettings) { OracleBMCSProviderSettings.resetToOriginal = SETTINGS.resetProvider('oraclebmcs'); } diff --git a/app/scripts/modules/titus/src/serverGroup/configure/wizard/capacity/capacitySelector.component.ts b/app/scripts/modules/titus/src/serverGroup/configure/wizard/capacity/capacitySelector.component.ts index 69a64ff2f64..59d006b6e11 100644 --- a/app/scripts/modules/titus/src/serverGroup/configure/wizard/capacity/capacitySelector.component.ts +++ b/app/scripts/modules/titus/src/serverGroup/configure/wizard/capacity/capacitySelector.component.ts @@ -6,7 +6,7 @@ module(CAPACITY_SELECTOR, []).component('titusServerGroupCapacitySelector', { command: '=', }, templateUrl: require('./capacitySelector.component.html'), - controller: function() { + controller() { this.minMaxDesiredTemplate = require('./minMaxDesiredFields.template.html'); this.preferSourceCapacityOptions = [ diff --git a/app/scripts/modules/titus/src/serverGroup/details/scalingPolicy/configBin/ConfigBinModal.tsx b/app/scripts/modules/titus/src/serverGroup/details/scalingPolicy/configBin/ConfigBinModal.tsx index 44f925f3212..bd1d1a9e7b5 100644 --- a/app/scripts/modules/titus/src/serverGroup/details/scalingPolicy/configBin/ConfigBinModal.tsx +++ b/app/scripts/modules/titus/src/serverGroup/details/scalingPolicy/configBin/ConfigBinModal.tsx @@ -114,7 +114,7 @@ export class ConfigBinModal extends React.Component): void { this.setState({ name: e.target.value }); - this.props.metricUpdated(this.props.metric, Object.assign({}, this.props.metric, { metricName: e.target.value })); + this.props.metricUpdated(this.props.metric, { ...this.props.metric, metricName: e.target.value }); } private metricUriUpdated(e: React.ChangeEvent): void { this.setState({ uri: e.target.value }); - this.props.metricUpdated(this.props.metric, Object.assign({}, this.props.metric, { atlasUri: e.target.value })); + this.props.metricUpdated(this.props.metric, { ...this.props.metric, atlasUri: e.target.value }); } private removeMetric(): void { diff --git a/app/scripts/modules/titus/src/serverGroup/details/scalingPolicy/targetTracking/upsertTargetTracking.controller.ts b/app/scripts/modules/titus/src/serverGroup/details/scalingPolicy/targetTracking/upsertTargetTracking.controller.ts index 63a029749c1..e87d7982bb1 100644 --- a/app/scripts/modules/titus/src/serverGroup/details/scalingPolicy/targetTracking/upsertTargetTracking.controller.ts +++ b/app/scripts/modules/titus/src/serverGroup/details/scalingPolicy/targetTracking/upsertTargetTracking.controller.ts @@ -92,7 +92,7 @@ export class UpsertTargetTrackingController implements IComponentController { serverGroupName: this.serverGroup.name, adjustmentType: null, name: this.policy.id, - targetTrackingConfiguration: Object.assign({}, this.policy.targetTrackingConfiguration), + targetTrackingConfiguration: { ...this.policy.targetTrackingConfiguration }, }; } } diff --git a/app/scripts/modules/titus/src/titus.settings.ts b/app/scripts/modules/titus/src/titus.settings.ts index 3d9166a41d1..b51b2b67768 100644 --- a/app/scripts/modules/titus/src/titus.settings.ts +++ b/app/scripts/modules/titus/src/titus.settings.ts @@ -9,7 +9,7 @@ export interface ITitusProviderSettings extends IProviderSettings { }; } -export const TitusProviderSettings: ITitusProviderSettings = SETTINGS.providers.titus || { +export const TitusProviderSettings: ITitusProviderSettings = (SETTINGS.providers.titus as ITitusProviderSettings) || { defaults: {}, }; if (TitusProviderSettings) { diff --git a/tslint.json b/tslint.json index 12f8a05e41b..10d4852ee19 100644 --- a/tslint.json +++ b/tslint.json @@ -43,12 +43,7 @@ "object-curly-spacing": "always", "object-literal-sort-keys": false, "one-line": [true, "check-catch", "check-else", "check-open-brace", "check-whitespace"], - "prefer-const": [ - true, - { - "destructuring": "all" - } - ], + "prefer-const": [true, { "destructuring": "all" }], "quotemark": [true, "single", "avoid-escape", "jsx-double"], "radix": true, "semicolon": ["always"],