From 3429ed0a8dc0c0ddb1a9ca9d4bca7c6f347a7da0 Mon Sep 17 00:00:00 2001 From: Dmitry Nehaychik <4dmitr@gmail.com> Date: Fri, 20 Oct 2017 17:31:36 +0300 Subject: [PATCH] chore(lint): update linter to follow angular lint file --- .../components/header/header.component.ts | 2 +- .../search-input/search-input.component.ts | 2 +- .../@theme/layouts/sample/sample.layout.ts | 2 +- .../notifications/notifications.component.ts | 24 ++++++++--------- .../electricity/electricity.component.ts | 2 +- .../security-cameras.component.ts | 2 +- .../pages/dashboard/solar/solar.component.ts | 2 +- .../status-card/status-card.component.ts | 2 +- .../temperature-dragger.component.ts | 26 +++++++++---------- .../temperature/temperature.component.ts | 8 +++--- .../traffic/traffic-chart.component.ts | 2 +- .../dashboard/traffic/traffic.component.ts | 2 +- .../form-inputs/form-inputs.component.ts | 4 +-- src/app/pages/maps/gmaps/gmaps.component.ts | 4 +-- .../hero-buttons/hero-buttons.component.ts | 2 +- .../modals/modal/modal.component.ts | 2 +- tslint.json | 13 +++++++--- 17 files changed, 54 insertions(+), 47 deletions(-) diff --git a/src/app/@theme/components/header/header.component.ts b/src/app/@theme/components/header/header.component.ts index e47e7018af..3b580a9dcc 100644 --- a/src/app/@theme/components/header/header.component.ts +++ b/src/app/@theme/components/header/header.component.ts @@ -12,7 +12,7 @@ import { AnalyticsService } from '../../../@core/utils/analytics.service'; export class HeaderComponent implements OnInit { - @Input() position: string = 'normal'; + @Input() position = 'normal'; user: any; diff --git a/src/app/@theme/components/search-input/search-input.component.ts b/src/app/@theme/components/search-input/search-input.component.ts index f6b12f4bf5..d9f0f10b4e 100644 --- a/src/app/@theme/components/search-input/search-input.component.ts +++ b/src/app/@theme/components/search-input/search-input.component.ts @@ -18,7 +18,7 @@ export class SearchInputComponent { @Output() search: EventEmitter = new EventEmitter(); - isInputShown: boolean = false; + isInputShown = false; showInput() { this.isInputShown = true; diff --git a/src/app/@theme/layouts/sample/sample.layout.ts b/src/app/@theme/layouts/sample/sample.layout.ts index 8489e066f1..6d35c093bb 100644 --- a/src/app/@theme/layouts/sample/sample.layout.ts +++ b/src/app/@theme/layouts/sample/sample.layout.ts @@ -122,7 +122,7 @@ export class SampleLayoutComponent implements OnDestroy { this.sidebarState$ = this.stateService.onSidebarState() .subscribe((sidebar: string) => { - this.sidebar = sidebar + this.sidebar = sidebar; }); const isBp = this.bpService.getByName('is'); diff --git a/src/app/pages/components/notifications/notifications.component.ts b/src/app/pages/components/notifications/notifications.component.ts index 2001cd1025..7df98b9739 100644 --- a/src/app/pages/components/notifications/notifications.component.ts +++ b/src/app/pages/components/notifications/notifications.component.ts @@ -13,18 +13,18 @@ export class NotificationsComponent { config: ToasterConfig; - position: string = 'toast-top-right'; - animationType: string = 'fade'; - title: string = 'HI there!'; - content: string = `I'm cool toaster!`; - timeout: number = 5000; - toastsLimit: number = 5; - type: string = 'default'; + position = 'toast-top-right'; + animationType = 'fade'; + title = 'HI there!'; + content = `I'm cool toaster!`; + timeout = 5000; + toastsLimit = 5; + type = 'default'; - isNewestOnTop: boolean = true; - isHideOnClick: boolean = true; - isDuplicatesPrevented: boolean = false; - isCloseButton: boolean = true; + isNewestOnTop = true; + isHideOnClick = true; + isDuplicatesPrevented = false; + isCloseButton = true; types: string[] = ['default', 'info', 'success', 'warning', 'error']; animations: string[] = ['fade', 'flyLeft', 'flyRight', 'slideDown', 'slideUp']; @@ -49,7 +49,7 @@ export class NotificationsComponent { const quote = this.quotes[quoteIndex]; this.showToast(type, quote.title, quote.body); - }; + } private showToast(type: string, title: string, body: string) { this.config = new ToasterConfig({ diff --git a/src/app/pages/dashboard/electricity/electricity.component.ts b/src/app/pages/dashboard/electricity/electricity.component.ts index ea6b144576..5879cf71ba 100644 --- a/src/app/pages/dashboard/electricity/electricity.component.ts +++ b/src/app/pages/dashboard/electricity/electricity.component.ts @@ -12,7 +12,7 @@ export class ElectricityComponent implements OnDestroy { data: Array; - type: string = 'week'; + type = 'week'; types = ['week', 'month', 'year']; currentTheme: string; diff --git a/src/app/pages/dashboard/security-cameras/security-cameras.component.ts b/src/app/pages/dashboard/security-cameras/security-cameras.component.ts index 9f03f337e4..ffb5df95d8 100644 --- a/src/app/pages/dashboard/security-cameras/security-cameras.component.ts +++ b/src/app/pages/dashboard/security-cameras/security-cameras.component.ts @@ -29,7 +29,7 @@ export class SecurityCamerasComponent { title: 'Log out', }]; - isSingleView: boolean = false; + isSingleView = false; selectCamera(camera: any) { this.selectedCamera = camera; diff --git a/src/app/pages/dashboard/solar/solar.component.ts b/src/app/pages/dashboard/solar/solar.component.ts index f6ec05bfa2..20a96fa44a 100644 --- a/src/app/pages/dashboard/solar/solar.component.ts +++ b/src/app/pages/dashboard/solar/solar.component.ts @@ -22,7 +22,7 @@ declare const echarts: any; }) export class SolarComponent implements AfterViewInit, OnDestroy { - private value: number = 0; + private value = 0; @Input('chartValue') set chartValue(value: number) { diff --git a/src/app/pages/dashboard/status-card/status-card.component.ts b/src/app/pages/dashboard/status-card/status-card.component.ts index 74859e8c8f..6260803052 100644 --- a/src/app/pages/dashboard/status-card/status-card.component.ts +++ b/src/app/pages/dashboard/status-card/status-card.component.ts @@ -22,5 +22,5 @@ export class StatusCardComponent { @Input() title: string; @Input() type: string; - @Input() on: boolean = true; + @Input() on = true; } diff --git a/src/app/pages/dashboard/temperature/temperature-dragger/temperature-dragger.component.ts b/src/app/pages/dashboard/temperature/temperature-dragger/temperature-dragger.component.ts index c9cf48f9a3..2dc06a2c40 100644 --- a/src/app/pages/dashboard/temperature/temperature-dragger/temperature-dragger.component.ts +++ b/src/app/pages/dashboard/temperature/temperature-dragger/temperature-dragger.component.ts @@ -14,21 +14,21 @@ export class TemperatureDraggerComponent implements AfterViewInit, OnChanges { @ViewChild('svgRoot') svgRoot: ElementRef; @Input() fillColors: string|string[] = '#2ec6ff'; - @Input() disableArcColor: string = '#999999'; - @Input() bottomAngle: number = 90; - @Input() arcThickness: number = 18; // CSS pixels - @Input() thumbRadius: number = 16; // CSS pixels - @Input() thumbBorder: number = 3; - @Input() maxLeap: number = 0.4; - - value: number = 50; + @Input() disableArcColor = '#999999'; + @Input() bottomAngle = 90; + @Input() arcThickness = 18; // CSS pixels + @Input() thumbRadius = 16; // CSS pixels + @Input() thumbBorder = 3; + @Input() maxLeap = 0.4; + + value = 50; @Output('valueChange') valueChange = new EventEmitter(); @Input('value') set setValue(value) { this.value = value; } - @Input() min: number = 0; // min output value - @Input() max: number = 100; // max output value + @Input() min = 0; // min output value + @Input() max = 100; // max output value @Input() step = 0.1; @Output() power = new EventEmitter(); @@ -49,13 +49,13 @@ export class TemperatureDraggerComponent implements AfterViewInit, OnChanges { this.invalidate(); } - off: boolean = false; + off = false; oldValue: number; svgControlId = new Date().getTime(); - scaleFactor: number = 1; + scaleFactor = 1; bottomAngleRad = 0; - radius: number = 100; + radius = 100; translateXValue = 0; translateYValue = 0; thickness = 6; diff --git a/src/app/pages/dashboard/temperature/temperature.component.ts b/src/app/pages/dashboard/temperature/temperature.component.ts index 2aa8b1da11..5160b7bf92 100644 --- a/src/app/pages/dashboard/temperature/temperature.component.ts +++ b/src/app/pages/dashboard/temperature/temperature.component.ts @@ -8,12 +8,12 @@ import { NbThemeService } from '@nebular/theme'; }) export class TemperatureComponent implements OnDestroy { - temperature: number = 24; - temperatureOff: boolean = false; + temperature = 24; + temperatureOff = false; temperatureMode = 'cool'; - humidity: number = 87; - humidityOff: boolean = false; + humidity = 87; + humidityOff = false; humidityMode = 'heat'; colors: any; diff --git a/src/app/pages/dashboard/traffic/traffic-chart.component.ts b/src/app/pages/dashboard/traffic/traffic-chart.component.ts index aa01693887..a17a93604b 100644 --- a/src/app/pages/dashboard/traffic/traffic-chart.component.ts +++ b/src/app/pages/dashboard/traffic/traffic-chart.component.ts @@ -14,7 +14,7 @@ const points = [300, 520, 435, 530, 730, 620, 660, 860]; }) export class TrafficChartComponent implements AfterViewInit, OnDestroy { - type: string = 'month'; + type = 'month'; types = ['week', 'month', 'year']; option: any = {}; themeSubscription: any; diff --git a/src/app/pages/dashboard/traffic/traffic.component.ts b/src/app/pages/dashboard/traffic/traffic.component.ts index b23961b62a..e1b30848b2 100644 --- a/src/app/pages/dashboard/traffic/traffic.component.ts +++ b/src/app/pages/dashboard/traffic/traffic.component.ts @@ -25,7 +25,7 @@ import { NbThemeService } from '@nebular/theme'; `, }) export class TrafficComponent implements OnDestroy { - type: string = 'month'; + type = 'month'; types = ['week', 'month', 'year']; currentTheme: string; themeSubscription: any; diff --git a/src/app/pages/forms/form-inputs/form-inputs.component.ts b/src/app/pages/forms/form-inputs/form-inputs.component.ts index ee3323c9f1..6299738fec 100644 --- a/src/app/pages/forms/form-inputs/form-inputs.component.ts +++ b/src/app/pages/forms/form-inputs/form-inputs.component.ts @@ -7,6 +7,6 @@ import { Component } from '@angular/core'; }) export class FormInputsComponent { - starRate: number = 2; - heartRate: number = 4; + starRate = 2; + heartRate = 4; } diff --git a/src/app/pages/maps/gmaps/gmaps.component.ts b/src/app/pages/maps/gmaps/gmaps.component.ts index 5f812f6e44..9f255e83e1 100644 --- a/src/app/pages/maps/gmaps/gmaps.component.ts +++ b/src/app/pages/maps/gmaps/gmaps.component.ts @@ -16,6 +16,6 @@ import { Component } from '@angular/core'; }) export class GmapsComponent { - lat: number = 51.678418; - lng: number = 7.809007; + lat = 51.678418; + lng = 7.809007; } diff --git a/src/app/pages/ui-features/buttons/hero-buttons/hero-buttons.component.ts b/src/app/pages/ui-features/buttons/hero-buttons/hero-buttons.component.ts index ad7c2f9c69..21581f32c1 100644 --- a/src/app/pages/ui-features/buttons/hero-buttons/hero-buttons.component.ts +++ b/src/app/pages/ui-features/buttons/hero-buttons/hero-buttons.component.ts @@ -8,7 +8,7 @@ import { NbThemeService } from '@nebular/theme'; }) export class HeroButtonComponent implements OnDestroy { - themeName: string = 'default'; + themeName = 'default'; settings: Array; themeSubscription: any; diff --git a/src/app/pages/ui-features/modals/modal/modal.component.ts b/src/app/pages/ui-features/modals/modal/modal.component.ts index 617409ec96..9619cde4ed 100644 --- a/src/app/pages/ui-features/modals/modal/modal.component.ts +++ b/src/app/pages/ui-features/modals/modal/modal.component.ts @@ -21,7 +21,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; export class ModalComponent { modalHeader: string; - modalContent: string = `Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy + modalContent = `Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.`; diff --git a/tslint.json b/tslint.json index ca154013f3..892922b0da 100644 --- a/tslint.json +++ b/tslint.json @@ -22,7 +22,8 @@ "forin": true, "import-blacklist": [ true, - "rxjs" + "rxjs", + "rxjs/Rx" ], "import-spacing": true, "indent": [ @@ -33,7 +34,7 @@ "label-position": true, "max-line-length": [ true, - 120 + 140 ], "member-access": false, "no-arg": true, @@ -51,6 +52,10 @@ "no-empty": false, "no-empty-interface": true, "no-eval": true, + "no-inferrable-types": [ + true, + "ignore-params" + ], "no-misused-new": true, "no-non-null-assertion": true, "no-shadowed-variable": true, @@ -77,6 +82,7 @@ ], "radix": true, "semicolon": [ + true, "always" ], "triple-equals": [ @@ -119,6 +125,7 @@ "use-input-property-decorator": true, "use-output-property-decorator": true, "use-host-property-decorator": true, + "no-input-rename": true, "no-output-rename": true, "use-life-cycle-interface": true, "use-pipe-transform-interface": true, @@ -128,4 +135,4 @@ "templates-use-public": true, "invoke-injectable": true } -} \ No newline at end of file +}