Skip to content

Commit

Permalink
chore(tslint): manually fix lint errors that don't have --fix
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 b1ddb67 commit be938ab
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { isEmpty, get } from 'lodash';

export type SupportedStage = 'stage';

type IWalker = (refContainer: any) => Array<string | number>[];
type IWalker = (refContainer: any) => Array<Array<string | number>>;

interface IReference {
category: SupportedStage;
Expand All @@ -25,7 +25,7 @@ export class ArtifactReferenceServiceProvider {
public removeReferenceFromStages(reference: string, stages: IStage[]) {
(stages || []).forEach(stage => {
this.references.forEach(ref => {
const paths: Array<string | number>[] = ref.walker(stage).filter(path => !isEmpty(path));
const paths: Array<Array<string | number>> = ref.walker(stage).filter(path => !isEmpty(path));
paths.map(p => p.slice(0)).forEach(path => {
let tail = path.pop();
let obj = stage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class ClustersSearchResultType extends SearchResultType<IClusterSearchResult> {
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 };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export function overridableComponent<P extends IOverridableProps, T extends Reac
public render() {
const Component = this.state && this.state.Component;
const isOverridden = Component && Component !== OriginalComponent;
const props = { ...this.props, ...(isOverridden ? { OriginalComponent } : {}) };
const props = { ...(this.props as any), ...(isOverridden ? { OriginalComponent } : {}) };

return Component ? <Component {...props} /> : <Spinner />;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,9 @@ export class CreatePipelineModal extends React.Component<ICreatePipelineModalPro
this.props.showCallback(false);
}

private handleTypeChange(option: Option): void {
this.setState({ command: { ...this.state.command, strategy: option.value } });
private handleTypeChange(option: Option<boolean>): void {
const strategy = option.value;
this.setState({ command: { ...this.state.command, strategy } });
}

private handleNameChange(e: React.ChangeEvent<HTMLInputElement>): void {
Expand Down
2 changes: 2 additions & 0 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -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,
Expand Down

0 comments on commit be938ab

Please sign in to comment.