Skip to content

Commit

Permalink
fix(tslint): errors
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveVanOpstal committed May 31, 2016
1 parent 0af0e4f commit ebe93e8
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/app/build/ability-sequence.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {DDragonDirective} from '../misc/ddragon.directive';
selector: 'g[ability-sequence]',
directives: [NgFor, NgClass, DDragonDirective],
template: `
<svg:g xmlns="http://www.w3.org/2000/svg" version="1.1" class="ability" [ngClass]="{ult : i == 3}" *ngFor="let spell of champion?.spells; let i = i">
<svg:g xmlns="http://www.w3.org/2000/svg" version="1.1" class="ability" [ngClass]="{ult : i == 3}" *ngFor="let spell of champion?.spells; let i = index">
<g fill="gray">
<rect x="10" [attr.y]="5 + (i * 50) + (i == 3 ? 5 : 0)" [attr.width]="width" height="30"></rect>
</g>
Expand Down
11 changes: 3 additions & 8 deletions src/app/build/items/item-slot.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import {Component, Input, Inject, forwardRef, OnInit} from '@angular/core';
import {Component, Input} from '@angular/core';
import {NgClass} from '@angular/common';
import {Observable} from 'rxjs/Observable';

import {ItemsComponent} from './items.component';
import {ItemComponent} from './item.component';
import {Item} from '../../misc/item';
import {Config} from '../config';
Expand All @@ -18,7 +17,7 @@ import * as d3 from 'd3'; // TODO: remove test
</template>`
})

export class ItemSlotComponent implements OnInit {
export class ItemSlotComponent {
@Input() id: number;
@Input() config: Config;
private items: Array<any> = new Array<any>();
Expand All @@ -29,11 +28,7 @@ export class ItemSlotComponent implements OnInit {
.domain([0, 3600000])
.range([0, 1460]);

constructor( @Inject(forwardRef(() => ItemsComponent)) private itemsComponent: ItemsComponent) {
}

ngOnInit() {
this.itemsComponent.addItemSlotComponent(this);
constructor() {
}

addItem(item: Item) {
Expand Down
6 changes: 3 additions & 3 deletions src/app/build/shop/pipes/tags.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export class TagsPipe implements PipeTransform {
if (!item.tags) {
return false;
}
if (tags && tags.length > 0) {
for (let tag in tags) {
if (tags) {
for (let index = 0; index < tags.length; index++) {
item.tags = item.tags.map(tag => tag.toLowerCase());
if (item.tags.indexOf(tags[tag].toLowerCase()) === -1) {
if (item.tags.indexOf(tags[index].toLowerCase()) === -1) {
return false;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/champions/pipes/sort.pipe.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ describe('SortPipe', () => {
champions = [champion1, champion2, champion3];
});

it('should order alphabetical on \'undefined\'', inject([SortPipe], (pipe) => {
let result = pipe.transform(champions, undefined);
it('should order alphabetical on \'null\'', inject([SortPipe], (pipe) => {
let result = pipe.transform(champions, null);
expect(result).toHaveEqualContent([champion2, champion1, champion3]); // alphabetical order
}));

Expand Down
5 changes: 2 additions & 3 deletions src/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,8 @@ export class Server {
}

private preRun() {
this.getRegions((regions) => {
for (let index in regions) {
let region = regions[index];
this.getRegions((regions: Array<string>) => {
for (let region of regions) {
this.champions[region] = [];
this.getChampions(region, this.handleChampions);
}
Expand Down
7 changes: 1 addition & 6 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
],
"ban": false,
"curly": false,
"forin": true,
"forin": false,
"label-position": true,
"label-undefined": true,
"no-arg": true,
Expand All @@ -54,7 +54,6 @@
"no-duplicate-variable": true,
"no-empty": false,
"no-eval": true,
"no-null-keyword": true,
"no-shadowed-variable": true,
"no-string-literal": true,
"no-switch-case-fall-through": true,
Expand All @@ -69,10 +68,6 @@
true,
"allow-null-check"
],
"use-strict": [
true,
"check-module"
],
"eofline": true,
"indent": [
true,
Expand Down

0 comments on commit ebe93e8

Please sign in to comment.