chore(lint): fix all code that doesn't pass tslint

* chore(lint): update to work with newer tslint

* chore(lint): fix all code that doesnt pass tslint

fix all code that doesnt pass tslint
This commit is contained in:
Dan Bucholtz
2017-07-05 16:21:55 -05:00
committed by GitHub
parent eb830d4202
commit efd54750bf
162 changed files with 626 additions and 470 deletions

View File

@@ -1,6 +1,6 @@
import { Component, NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule, NavController, Platform } from '../../../..';
import { IonicApp, IonicModule, NavController } from '../../../..';
@Component({
@@ -11,7 +11,7 @@ export class E2EPage {
webview: string = '';
counter: number = 0;
constructor(plt: Platform, public navCtrl: NavController) {}
constructor(public navCtrl: NavController) {}
addItems() {
if (this.items.length === 0) {
@@ -21,7 +21,7 @@ export class E2EPage {
}
}
headerFn(record: any, index: number, records: any[]) {
headerFn(_record: any, index: number, _records: any[]) {
if (index % 4 === 0) {
return index + ' is divisible by 4';
}
@@ -59,7 +59,7 @@ export class E2EPage {
this.items[index] = { value: Math.floor(Math.random() * 10000), someMethod: () => '!!' };
}
trackByFn(index: number, item: any) {
trackByFn(_index: number, item: any) {
return item.value;
}

View File

@@ -1,4 +1,4 @@
import { Component, ViewEncapsulation, NgModule } from '@angular/core';
import { Component, NgModule, ViewEncapsulation } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule } from '../../../..';

View File

@@ -1,4 +1,4 @@
import { Component, ViewEncapsulation, NgModule } from '@angular/core';
import { Component, NgModule, ViewEncapsulation } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule } from '../../../..';
@@ -37,7 +37,7 @@ export class E2EPage {
}
}
headerFn(record: any, recordIndex: number, records: any[]) {
headerFn(record: any) {
if (this.lastMonth !== record.date.getMonth()) {
this.lastMonth = record.date.getMonth();
@@ -49,7 +49,7 @@ export class E2EPage {
return null;
}
footerFn(record: any, recordIndex: number, records: any[]) {
footerFn(_record: any, recordIndex: number, records: any[]) {
if (recordIndex === records.length - 1) {
return true;

View File

@@ -1,4 +1,4 @@
import { Component, ViewChild, ElementRef, NgModule } from '@angular/core';
import { Component, ElementRef, NgModule, ViewChild } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule, Platform } from '../../../..';
@@ -32,7 +32,7 @@ export class E2EPage {
}
}
headerFn(record: any, index: number, records: any[]) {
headerFn(_record: any, index: number) {
if (index % 4 === 0) {
return index + ' is divisible by 4';
}

View File

@@ -22,7 +22,7 @@ export class E2EPage {
}
}
headerFn(record: any, recordIndex: number) {
headerFn(_record: any, recordIndex: number) {
if (recordIndex > 0 && recordIndex % 100 === 0) {
return recordIndex;
}

View File

@@ -1,5 +1,5 @@
import { VirtualCell, VirtualData, VirtualNode } from '../virtual-util';
import { processRecords, populateNodeData, initReadNodes, getVirtualHeight, adjustRendered, estimateHeight } from '../virtual-util';
import { adjustRendered, estimateHeight, getVirtualHeight, initReadNodes, populateNodeData, processRecords } from '../virtual-util';
import { mockPlatform } from '../../../util/mock-providers';
@@ -22,7 +22,7 @@ describe('VirtualScroll', () => {
ftrWidth: viewportWidth,
ftrHeight: HEIGHT_FOOTER
};
window.getComputedStyle = function(element) {
window.getComputedStyle = function() {
var styles: any = {
marginTop: '0px',
marginRight: '0px',
@@ -229,7 +229,7 @@ describe('VirtualScroll', () => {
let startCellIndex = 0;
let endCellIndex = 0;
populateNodeData(startCellIndex, endCellIndex, data.viewWidth, true,
populateNodeData(startCellIndex, endCellIndex, true,
cells, records, nodes, viewContainer,
itmTmp, hdrTmp, ftrTmp, false);
@@ -257,7 +257,7 @@ describe('VirtualScroll', () => {
let startCellIndex = 2;
let endCellIndex = 5;
populateNodeData(startCellIndex, endCellIndex, data.viewWidth, true,
populateNodeData(startCellIndex, endCellIndex, true,
cells, records, nodes, viewContainer,
itmTmp, hdrTmp, ftrTmp, false);
@@ -286,7 +286,7 @@ describe('VirtualScroll', () => {
let startCellIndex = 2;
let endCellIndex = 4;
populateNodeData(startCellIndex, endCellIndex, data.viewWidth, true,
populateNodeData(startCellIndex, endCellIndex, true,
cells, records, nodes, viewContainer,
itmTmp, hdrTmp, ftrTmp, true);

View File

@@ -1,10 +1,10 @@
import { AfterContentInit, ChangeDetectorRef, ContentChild, Directive, DoCheck, ElementRef, Input, IterableChanges, IterableDiffer, IterableDiffers, NgZone, OnDestroy, Renderer, TrackByFn } from '@angular/core';
import { adjustRendered, calcDimensions, estimateHeight, initReadNodes, processRecords, populateNodeData, updateDimensions, updateNodeContext, writeToNodes } from './virtual-util';
import { adjustRendered, calcDimensions, estimateHeight, initReadNodes, populateNodeData, processRecords, updateDimensions, updateNodeContext, writeToNodes } from './virtual-util';
import { Config } from '../../config/config';
import { Content, ScrollEvent } from '../content/content';
import { DomController } from '../../platform/dom-controller';
import { isFunction, isPresent, assert } from '../../util/util';
import { assert, isFunction, isPresent } from '../../util/util';
import { Platform } from '../../platform/platform';
import { ViewController } from '../../navigation/view-controller';
import { VirtualCell, VirtualData, VirtualNode } from './virtual-util';
@@ -556,7 +556,7 @@ export class VirtualScroll implements DoCheck, AfterContentInit, OnDestroy {
this._zone.run(() => {
populateNodeData(
data.topCell, data.bottomCell,
data.viewWidth, true,
true,
cells, records, nodes,
this._itmTmp.viewContainer,
this._itmTmp.templateRef,
@@ -694,7 +694,7 @@ export class VirtualScroll implements DoCheck, AfterContentInit, OnDestroy {
var hasChanges = populateNodeData(
data.topCell, data.bottomCell,
data.viewWidth, diff > 0,
diff > 0,
cells, records, nodes,
this._itmTmp.viewContainer,
this._itmTmp.templateRef,

View File

@@ -1,4 +1,4 @@
import { ViewContainerRef, TemplateRef, EmbeddedViewRef } from '@angular/core';
import { EmbeddedViewRef, TemplateRef, ViewContainerRef } from '@angular/core';
import { Platform } from '../../platform/platform';
@@ -127,7 +127,7 @@ function addCell(previousCell: VirtualCell, recordIndex: number, tmpl: number, t
/**
* NO DOM
*/
export function populateNodeData(startCellIndex: number, endCellIndex: number, viewportWidth: number, scrollingDown: boolean,
export function populateNodeData(startCellIndex: number, endCellIndex: number, scrollingDown: boolean,
cells: VirtualCell[], records: any[], nodes: VirtualNode[], viewContainer: ViewContainerRef,
itmTmp: TemplateRef<VirtualContext>, hdrTmp: TemplateRef<VirtualContext>, ftrTmp: TemplateRef<VirtualContext>,
initialLoad: boolean): boolean {
@@ -330,7 +330,7 @@ export function updateDimensions(plt: Platform, nodes: VirtualNode[], cells: Vir
tmpl: -1
};
for (var i = 0; i < totalCells; i++) {
for (let i = 0; i < totalCells; i++) {
cell = cells[i];
if (previousCell.left + previousCell.width + cell.width > data.viewWidth) {
@@ -481,7 +481,7 @@ export function adjustRendered(cells: VirtualCell[], data: VirtualData) {
data.bottomCell = Math.min(data.bottomViewCell + viewableRenderedPadding, totalCells - 1);
data.topCell = Math.max(data.bottomCell - 2, 0);
for (var i = data.bottomCell; i >= 0; i--) {
for (let i = data.bottomCell; i >= 0; i--) {
cell = cells[i];
if (cell.row !== lastRow) {
cellsRenderHeight += cell.height;
@@ -599,7 +599,7 @@ function calcWidth(viewportWidth: number, approxWidth: string): number {
/**
* NO DOM
*/
function calcHeight(viewportHeight: number, approxHeight: string): number {
function calcHeight(_viewportHeight: number, approxHeight: string): number {
if (approxHeight.indexOf('px') > 0) {
return parseFloat(approxHeight);
}