Skip to content

Commit 09fc3a4

Browse files
committed
Lint code
1 parent cf88fb8 commit 09fc3a4

File tree

3 files changed

+23
-21
lines changed

3 files changed

+23
-21
lines changed

projects/fab-speed-dial/src/lib/fab-speed-dial.ts

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
} from '@angular/core';
1414
import { MatButton } from '@angular/material';
1515

16-
const Z_INDEX_ITEM: number = 23;
16+
const Z_INDEX_ITEM = 23;
1717

1818
export type Direction = 'up' | 'down' | 'left' | 'right';
1919
export type AnimationMode = 'fling' | 'scale';
@@ -45,7 +45,7 @@ export class EcoFabSpeedDialActionsComponent implements AfterContentInit {
4545
this._buttons.toArray().forEach((button, i) => {
4646
this.renderer.addClass(button._getHostElement(), 'eco-fab-action-item');
4747
this.changeElementStyle(button._getHostElement(), 'z-index', '' + (Z_INDEX_ITEM - i));
48-
})
48+
});
4949
}
5050

5151
show() {
@@ -63,7 +63,7 @@ export class EcoFabSpeedDialActionsComponent implements AfterContentInit {
6363
this.changeElementStyle(button._getHostElement(), 'transition-delay', transitionDelay + 'ms');
6464
this.changeElementStyle(button._getHostElement(), 'opacity', '1');
6565
this.changeElementStyle(button._getHostElement(), 'transform', transform);
66-
})
66+
});
6767
}
6868
}
6969

@@ -83,14 +83,15 @@ export class EcoFabSpeedDialActionsComponent implements AfterContentInit {
8383
this.changeElementStyle(button._getHostElement(), 'transition-delay', transitionDelay + 'ms');
8484
this.changeElementStyle(button._getHostElement(), 'opacity', opacity);
8585
this.changeElementStyle(button._getHostElement(), 'transform', transform);
86-
})
86+
});
8787
}
8888
}
8989

9090
private getTranslateFunction(value: string) {
91-
let dir = this._parent.direction;
92-
let translateFn = (dir === 'up' || dir === 'down') ? 'translateY' : 'translateX';
93-
let sign = (dir === 'down' || dir === 'right') ? '-' : '';
91+
const dir = this._parent.direction;
92+
const translateFn = (dir === 'up' || dir === 'down') ? 'translateY' : 'translateX';
93+
const sign = (dir === 'down' || dir === 'right') ? '-' : '';
94+
9495
return translateFn + '(' + sign + value + ')';
9596
}
9697

@@ -112,15 +113,15 @@ export class EcoFabSpeedDialActionsComponent implements AfterContentInit {
112113
encapsulation: ViewEncapsulation.None,
113114
})
114115
export class EcoFabSpeedDialComponent implements AfterContentInit {
115-
private isInitialized: boolean = false;
116+
private isInitialized = false;
116117
private _direction: Direction = 'up';
117-
private _open: boolean = false;
118+
private _open = false;
118119
private _animationMode: AnimationMode = 'fling';
119120

120121
/**
121122
* Whether this speed dial is fixed on screen (user cannot change it by clicking)
122123
*/
123-
@Input() fixed: boolean = false;
124+
@Input() fixed = false;
124125

125126
/**
126127
* Whether this speed dial is opened
@@ -131,7 +132,7 @@ export class EcoFabSpeedDialComponent implements AfterContentInit {
131132
}
132133

133134
set open(open: boolean) {
134-
let previousOpen = this._open;
135+
const previousOpen = this._open;
135136
this._open = open;
136137
if (previousOpen !== this._open) {
137138
this.openChange.emit(this._open);
@@ -149,7 +150,7 @@ export class EcoFabSpeedDialComponent implements AfterContentInit {
149150
}
150151

151152
set direction(direction: Direction) {
152-
let previousDirection = this._direction;
153+
const previousDirection = this._direction;
153154
this._direction = direction;
154155
if (previousDirection !== this.direction) {
155156
this._setElementClass(previousDirection, false);
@@ -169,7 +170,7 @@ export class EcoFabSpeedDialComponent implements AfterContentInit {
169170
}
170171

171172
set animationMode(animationMode: AnimationMode) {
172-
let previousAnimationMode = this._animationMode;
173+
const previousAnimationMode = this._animationMode;
173174
this._animationMode = animationMode;
174175
if (previousAnimationMode !== this._animationMode) {
175176
this._setElementClass(previousAnimationMode, false);
@@ -245,9 +246,9 @@ export class EcoFabSpeedDialTriggerComponent {
245246
*/
246247
@HostBinding('class.eco-spin') get sp() {
247248
return this.spin;
248-
};
249+
}
249250

250-
@Input() spin: boolean = false;
251+
@Input() spin = false;
251252

252253
constructor(injector: Injector) {
253254
this._parent = injector.get(EcoFabSpeedDialComponent);

projects/fab-speed-dial/tslint.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
{
22
"extends": "../../tslint.json",
33
"rules": {
4+
"no-use-before-declare": false,
45
"directive-selector": [
56
true,
67
"attribute",
7-
"lib",
8+
"eco",
89
"camelCase"
910
],
1011
"component-selector": [
1112
true,
1213
"element",
13-
"lib",
14+
"eco",
1415
"kebab-case"
1516
]
1617
}

src/app/app.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ export class AppComponent {
1212

1313
private _fixed = false;
1414

15-
public open: boolean = false;
16-
public spin: boolean = false;
17-
public direction: string = 'up';
18-
public animationMode: string = 'fling';
15+
public open = false;
16+
public spin = false;
17+
public direction = 'up';
18+
public animationMode = 'fling';
1919

2020
get fixed(): boolean {
2121
return this._fixed;

0 commit comments

Comments
 (0)