Skip to content

Commit

Permalink
chore(tslint): ❯ npx tslint --fix -p tsconfig.json
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen authored and Justin Reynolds committed Apr 10, 2018
1 parent e74be82 commit b1ddb67
Show file tree
Hide file tree
Showing 168 changed files with 382 additions and 399 deletions.
2 changes: 1 addition & 1 deletion app/scripts/modules/amazon/src/aws.settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface IAWSProviderSettings extends IProviderSettings {
disableSpotPricing?: boolean;
}

export const AWSProviderSettings: IAWSProviderSettings = <IAWSProviderSettings>SETTINGS.providers.aws || {
export const AWSProviderSettings: IAWSProviderSettings = (SETTINGS.providers.aws as IAWSProviderSettings) || {
defaults: {},
};
if (AWSProviderSettings) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface IAmazonAsg extends IAsg {
healthCheckType: string;
healthCheckGracePeriod: number;
terminationPolicies: string[];
enabledMetrics: { metric: string }[];
enabledMetrics: Array<{ metric: string }>;
vpczoneIdentifier?: string;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}
Expand All @@ -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}`,
});
}
Expand All @@ -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,
});
}
Expand All @@ -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}`,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 &&
Expand Down Expand Up @@ -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));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class LoadBalancerActions extends React.Component<ILoadBalancerActionsPro
account: loadBalancerFromParams.accountId,
applicationName: app.name,
taskMonitorConfig: taskMonitor,
submitMethod: submitMethod,
submitMethod,
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ describe('Controller: LoadBalancerDetailsCtrl', function() {
const app = applicationModelBuilder.createApplication('app', { key: 'loadBalancers', lazy: true });
app.loadBalancers.data.push(loadBalancer);
controller = $controller(AwsLoadBalancerDetailsController, {
$scope: $scope,
loadBalancer: loadBalancer,
app: app,
$state: $state,
$scope,
loadBalancer,
app,
$state,
});
},
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface ILoadBalancerFromStateParams {
export class AwsLoadBalancerDetailsController implements IController {
public application: Application;
public elbProtocol: string;
public listeners: { in: string; targets: ITargetGroup[] }[];
public listeners: Array<{ in: string; targets: ITargetGroup[] }>;
public loadBalancerFromParams: ILoadBalancerFromStateParams;
public loadBalancer: IAmazonLoadBalancer;
public securityGroups: ISecurityGroup[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, '[_\\-]') + '*',
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class AmazonServerGroupActions extends React.Component<IAmazonServerGroup
provider: 'aws',
taskMonitorConfig: taskMonitor,
interestingHealthProviderNames: undefined as string[],
submitMethod: submitMethod,
submitMethod,
askForReason: true,
platformHealthOnlyShowOverride: app.attributes.platformHealthOnlyShowOverride,
platformHealthType: 'Amazon',
Expand Down Expand Up @@ -123,7 +123,7 @@ export class AmazonServerGroupActions extends React.Component<IAmazonServerGroup
taskMonitorConfig: taskMonitor,
platformHealthOnlyShowOverride: app.attributes.platformHealthOnlyShowOverride,
platformHealthType: 'Amazon',
submitMethod: submitMethod,
submitMethod,
askForReason: true,
};

Expand Down Expand Up @@ -181,7 +181,7 @@ export class AmazonServerGroupActions extends React.Component<IAmazonServerGroup
taskMonitorConfig: taskMonitor,
platformHealthOnlyShowOverride: app.attributes.platformHealthOnlyShowOverride,
platformHealthType: 'Amazon',
submitMethod: submitMethod,
submitMethod,
askForReason: true,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const scalingPolicyPopover: IComponentOptions = {
serverGroup: '=',
},
templateUrl: require('./scalingPolicyPopover.component.html'),
controller: function() {
controller() {
this.$onInit = () => {
this.alarm = this.policy.alarms[0];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ describe('Component: metric selector', () => {
);

const initialize = () => {
$ctrl = <MetricSelectorController>$componentController(
$ctrl = $componentController(
'awsMetricSelector',
{ $scope, cloudMetricsReader },
{ alarm, serverGroup, alarmUpdated },
);
) as MetricSelectorController;
$ctrl.$onInit();
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
);
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand All @@ -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));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ class AmazonApplicationNameValidator implements IApplicationNameValidator {
}

return {
warnings: warnings,
errors: errors,
warnings,
errors,
};
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/modules/appengine/src/appengine.settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export interface IAppengineProviderSettings extends IProviderSettings {
};
}

export const AppengineProviderSettings: IAppengineProviderSettings = <IAppengineProviderSettings>SETTINGS.providers
.appengine || { defaults: {} };
export const AppengineProviderSettings: IAppengineProviderSettings = (SETTINGS.providers
.appengine as IAppengineProviderSettings) || { defaults: {} };
if (AppengineProviderSettings) {
AppengineProviderSettings.resetToOriginal = SETTINGS.resetProvider('appengine');
}
Original file line number Diff line number Diff line change
Expand Up @@ -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('^');
}
Expand All @@ -84,7 +84,7 @@ class AppengineInstanceDetailsController implements IController {
buttonText: 'Terminate ' + shortName,
account: instance.account,
taskMonitorConfig: taskMonitor,
submitMethod: submitMethod,
submitMethod,
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class AppengineLoadBalancerDetailsController implements IController {
body: this.getConfirmationModalBodyHtml(),
account: this.loadBalancer.account,
taskMonitorConfig: taskMonitor,
submitMethod: submitMethod,
submitMethod,
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class AppengineServerGroupCommandBuilder {
};

const viewState: IViewState = {
mode: mode,
mode,
submitButtonLabel: this.getSubmitButtonLabel(mode),
disableStrategySelection: mode === 'create',
};
Expand Down
Loading

0 comments on commit b1ddb67

Please sign in to comment.