Skip to content

Commit d8e670c

Browse files
committed
style(tslint): add tslint
Closes ionic-team#5756
1 parent 86fc741 commit d8e670c

19 files changed

Lines changed: 111 additions & 35 deletions

File tree

gulpfile.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,3 +876,17 @@ gulp.task('tooling', function(){
876876
.pipe(gulp.dest('dist'));
877877
})
878878
});
879+
880+
881+
/**
882+
* TS LINT
883+
*/
884+
gulp.task("tslint", function() {
885+
var tslint = require("gulp-tslint");
886+
gulp.src([
887+
'ionic/**/*.ts',
888+
'!ionic/components/*/test/**/*',
889+
'!ionic/util/test/*'
890+
]).pipe(tslint())
891+
.pipe(tslint.report('verbose'));
892+
});

ionic/animations/animation.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export class Animation {
179179
if (!isNaN(num)) {
180180
fxState.num = num;
181181
}
182-
fxState.unit = (r[0] != r[2] ? r[2] : '');
182+
fxState.unit = (r[0] !== r[2] ? r[2] : '');
183183

184184
} else if (typeof val === 'number') {
185185
fxState.num = val;
@@ -216,7 +216,7 @@ export class Animation {
216216
}
217217
return this;
218218
}
219-
}
219+
};
220220
}
221221

222222
get after() {
@@ -239,7 +239,7 @@ export class Animation {
239239
}
240240
return this;
241241
}
242-
}
242+
};
243243
}
244244

245245
play(opts: PlayOptions = {}) {
@@ -818,10 +818,10 @@ interface EffectState {
818818
}
819819

820820
const TRANSFORMS = {
821-
'translateX':1, 'translateY':1, 'translateZ':1,
822-
'scale':1, 'scaleX':1, 'scaleY':1, 'scaleZ':1,
823-
'rotate':1, 'rotateX':1, 'rotateY':1, 'rotateZ':1,
824-
'skewX':1, 'skewY':1, 'perspective':1
821+
'translateX': 1, 'translateY': 1, 'translateZ': 1,
822+
'scale': 1, 'scaleX': 1, 'scaleY': 1, 'scaleZ': 1,
823+
'rotate': 1, 'rotateX': 1, 'rotateY': 1, 'rotateZ': 1,
824+
'skewX': 1, 'skewY': 1, 'perspective': 1
825825
};
826826

827827
const CSS_VALUE_REGEX = /(^-?\d*\.?\d*)(.*)/;

ionic/components/ion.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {ElementRef} from 'angular2/core';
22
import * as dom from '../util/dom';
33

4-
let ids:number = 0;
4+
let ids: number = 0;
55

66
/**
77
* Base class for all Ionic components. Exposes some common functionality

ionic/config/bootstrap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {Translate} from '../translation/translate';
2020
/**
2121
* @private
2222
*/
23-
export function ionicProviders(args: any={}) {
23+
export function ionicProviders(args: any = {}) {
2424
let platform = new Platform();
2525
let navRegistry = new NavRegistry(args.pages);
2626

ionic/decorators/app.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {TapClick} from '../components/tap-click/tap-click';
55
import {ionicProviders} from '../config/bootstrap';
66
import {IONIC_DIRECTIVES} from '../config/directives';
77

8-
const _reflect: any=Reflect;
8+
const _reflect: any = Reflect;
99

1010
export interface AppMetadata {
1111
prodMode?: boolean;
@@ -64,7 +64,7 @@ export interface AppMetadata {
6464
* @property {string} [template] - the template to use for the app root.
6565
* @property {string} [templateUrl] - a relative URL pointing to the template to use for the app root.
6666
*/
67-
export function App(args: AppMetadata={}) {
67+
export function App(args: AppMetadata = {}) {
6868

6969
return function(cls) {
7070
// get current annotations
@@ -100,5 +100,5 @@ export function App(args: AppMetadata={}) {
100100
});
101101

102102
return cls;
103-
}
103+
};
104104
}

ionic/decorators/page.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import {Component, ChangeDetectionStrategy, ViewEncapsulation, Type} from 'angular2/core'
1+
import {Component, ChangeDetectionStrategy, ViewEncapsulation, Type} from 'angular2/core';
22
import {IONIC_DIRECTIVES} from '../config/directives';
33

4-
const _reflect: any=Reflect;
4+
const _reflect: any = Reflect;
55

66
export interface PageMetadata {
77
selector?: string;
@@ -107,5 +107,5 @@ export function Page(config: PageMetadata) {
107107
annotations.push(new Component(config));
108108
_reflect.defineMetadata('annotations', annotations, cls);
109109
return cls;
110-
}
110+
};
111111
}

ionic/gestures/gesture.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class Gesture {
3636
}
3737

3838
on(type: string, cb: Function) {
39-
if(type == 'pinch' || type == 'rotate') {
39+
if (type === 'pinch' || type === 'rotate') {
4040
this._hammer.get('pinch').set({enable: true});
4141
}
4242
this._hammer.on(type, cb);

ionic/gestures/hammer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* tslint:disable */
12
import {assign} from '../util/util';
23

34
const win: any = window;

ionic/platform/platform.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ import {Config} from '../config/config';
2525
*/
2626
export class Platform {
2727
private _platforms: Array<string>;
28-
private _versions: any={};
28+
private _versions: any = {};
2929
private _dir: string;
3030
private _lang: string;
3131
private _url: string;
3232
private _qs: any;
3333
private _ua: string;
3434
private _bPlt: string;
35-
private _onResizes: Array<Function>=[];
35+
private _onResizes: Array<Function> = [];
3636
private _readyPromise: Promise<any>;
3737
private _readyResolve: any;
3838
private _engineReady: any;
@@ -43,7 +43,7 @@ export class Platform {
4343
*/
4444
platformOverride: string;
4545

46-
constructor(platforms=[]) {
46+
constructor(platforms = []) {
4747
this._platforms = platforms;
4848
this._readyPromise = new Promise(res => { this._readyResolve = res; } );
4949
}

ionic/transitions/transition-ios.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const OPACITY = 'opacity';
88
const TRANSLATEX = 'translateX';
99
const OFF_RIGHT = '99.5%';
1010
const OFF_LEFT = '-33%';
11-
const CENTER = '0%'
11+
const CENTER = '0%';
1212
const OFF_OPACITY = 0.8;
1313
const SHOW_BACK_BTN_CSS = 'show-back-button';
1414

0 commit comments

Comments
 (0)