From be938ab296d0dbec2a888f38086f8ec232232e17 Mon Sep 17 00:00:00 2001 From: Chris Thielen Date: Tue, 10 Apr 2018 12:34:55 -0700 Subject: [PATCH] chore(tslint): manually fix lint errors that don't have --fix --- .../modules/core/src/artifact/ArtifactReferenceService.ts | 4 ++-- .../core/src/chaosMonkey/chaosMonkeyExceptions.component.ts | 3 ++- .../modules/core/src/cluster/clusterSearchResultType.tsx | 3 ++- .../modules/core/src/overrideRegistry/Overridable.tsx | 2 +- .../modules/core/src/pipeline/create/CreatePipelineModal.tsx | 5 +++-- tslint.json | 2 ++ 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/scripts/modules/core/src/artifact/ArtifactReferenceService.ts b/app/scripts/modules/core/src/artifact/ArtifactReferenceService.ts index e10d70de003..c0db6a52c2a 100644 --- a/app/scripts/modules/core/src/artifact/ArtifactReferenceService.ts +++ b/app/scripts/modules/core/src/artifact/ArtifactReferenceService.ts @@ -4,7 +4,7 @@ import { isEmpty, get } from 'lodash'; export type SupportedStage = 'stage'; -type IWalker = (refContainer: any) => Array[]; +type IWalker = (refContainer: any) => Array>; interface IReference { category: SupportedStage; @@ -25,7 +25,7 @@ export class ArtifactReferenceServiceProvider { public removeReferenceFromStages(reference: string, stages: IStage[]) { (stages || []).forEach(stage => { this.references.forEach(ref => { - const paths: Array[] = 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/chaosMonkey/chaosMonkeyExceptions.component.ts b/app/scripts/modules/core/src/chaosMonkey/chaosMonkeyExceptions.component.ts index 8863478bb06..3ec9e5cd129 100644 --- a/app/scripts/modules/core/src/chaosMonkey/chaosMonkeyExceptions.component.ts +++ b/app/scripts/modules/core/src/chaosMonkey/chaosMonkeyExceptions.component.ts @@ -57,8 +57,9 @@ export class ChaosMonkeyExceptionsController { public configureMatches(): void { this.clusterMatches.length = 0; this.config.exceptions.forEach((exception: IChaosMonkeyExceptionRule) => { + const { region: location, ...clusterMatchRule } = exception; // the "location" field in chaos monkey exceptions is mapped as "region", so we have to massage it a bit... - const rule: IClusterMatchRule = { ...exception, location: exception.region }; + const rule: IClusterMatchRule = { ...clusterMatchRule, location }; this.clusterMatches.push( this.application.clusters .filter(c => diff --git a/app/scripts/modules/core/src/cluster/clusterSearchResultType.tsx b/app/scripts/modules/core/src/cluster/clusterSearchResultType.tsx index 7decc22f238..25a47049522 100644 --- a/app/scripts/modules/core/src/cluster/clusterSearchResultType.tsx +++ b/app/scripts/modules/core/src/cluster/clusterSearchResultType.tsx @@ -76,7 +76,8 @@ class ClustersSearchResultType extends SearchResultType { private makeSearchResult(serverGroup: IServerGroupSearchResult): IClusterSearchResult { const type = this.id; const urlBuilder = urlBuilderRegistry.getBuilder(type); - const href = urlBuilder.build({ type, ...serverGroup }, ReactInjector.$state); + const input = { type, ...serverGroup }; + const href = urlBuilder.build(input, 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/overrideRegistry/Overridable.tsx b/app/scripts/modules/core/src/overrideRegistry/Overridable.tsx index c186b336214..e1b14328484 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/pipeline/create/CreatePipelineModal.tsx b/app/scripts/modules/core/src/pipeline/create/CreatePipelineModal.tsx index 9c29813e338..93699f2eff1 100644 --- a/app/scripts/modules/core/src/pipeline/create/CreatePipelineModal.tsx +++ b/app/scripts/modules/core/src/pipeline/create/CreatePipelineModal.tsx @@ -194,8 +194,9 @@ export class CreatePipelineModal extends React.Component): void { + const strategy = option.value; + this.setState({ command: { ...this.state.command, strategy } }); } private handleNameChange(e: React.ChangeEvent): void { diff --git a/tslint.json b/tslint.json index 10d4852ee19..a4415265ce1 100644 --- a/tslint.json +++ b/tslint.json @@ -1,8 +1,10 @@ { "extends": ["tslint:latest", "tslint-react", "tslint-eslint-rules", "tslint-config-prettier"], "rules": { + "ban-types": false, "ordered-imports": false, "no-var-requires": false, + "no-namespace": false, "no-implicit-dependencies": false, "no-this-assignment": false, "max-classes-per-file": false,