From 78058c3591f11a1fada94e3ac2b1402ec6bf82b1 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 10 Apr 2018 23:49:46 -0400 Subject: [PATCH] lint fixes --- src/popup/accounts/two-factor-options.component.ts | 4 ++-- src/popup/accounts/two-factor.component.ts | 10 +++++----- src/popup/app-routing.module.ts | 6 +++--- src/popup/app.component.ts | 4 ++-- src/popup/app.module.ts | 1 + src/popup/components/ciphers-list.component.ts | 2 -- src/popup/main.ts | 4 ++-- src/popup/services/services.module.ts | 6 +++--- src/popup/tools/export.component.ts | 8 ++++---- .../tools/password-generator-history.component.ts | 2 +- src/popup/tools/password-generator.component.ts | 2 +- src/popup/vault/ciphers.component.ts | 8 ++++---- src/popup/vault/current-tab.component.ts | 4 +--- src/popup/vault/groupings.component.ts | 8 ++++---- src/services/browserPlatformUtils.service.ts | 2 +- 15 files changed, 34 insertions(+), 37 deletions(-) diff --git a/src/popup/accounts/two-factor-options.component.ts b/src/popup/accounts/two-factor-options.component.ts index 7f577f2272..779d4813c1 100644 --- a/src/popup/accounts/two-factor-options.component.ts +++ b/src/popup/accounts/two-factor-options.component.ts @@ -1,4 +1,4 @@ -import { Component, } from '@angular/core'; +import { Component } from '@angular/core'; import { Router } from '@angular/router'; import { ToasterService } from 'angular2-toaster'; @@ -9,7 +9,7 @@ import { I18nService } from 'jslib/abstractions/i18n.service'; import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; import { - TwoFactorOptionsComponent as BaseTwoFactorOptionsComponent + TwoFactorOptionsComponent as BaseTwoFactorOptionsComponent, } from 'jslib/angular/components/two-factor-options.component'; @Component({ diff --git a/src/popup/accounts/two-factor.component.ts b/src/popup/accounts/two-factor.component.ts index c0da93e0e3..6006c15786 100644 --- a/src/popup/accounts/two-factor.component.ts +++ b/src/popup/accounts/two-factor.component.ts @@ -60,7 +60,7 @@ export class TwoFactorComponent extends BaseTwoFactorComponent { } this.changeDetectorRef.detectChanges(); - }) + }); }); this.showNewWindowMessage = this.platformUtilsService.isSafari(); @@ -70,8 +70,8 @@ export class TwoFactorComponent extends BaseTwoFactorComponent { return; } - var isDuo = this.selectedProviderType == TwoFactorProviderType.Duo || - this.selectedProviderType == TwoFactorProviderType.OrganizationDuo; + const isDuo = this.selectedProviderType === TwoFactorProviderType.Duo || + this.selectedProviderType === TwoFactorProviderType.OrganizationDuo; if (!this.platformUtilsService.isSafari() || !isDuo) { return; } @@ -86,7 +86,7 @@ export class TwoFactorComponent extends BaseTwoFactorComponent { type: 'duo', host: params.Host, signature: params.Signature, - } + }, }); }, 500); } @@ -106,7 +106,7 @@ export class TwoFactorComponent extends BaseTwoFactorComponent { window.setTimeout(() => { BrowserApi.tabSendMessage(sendSuccessToTab, { command: '2faPageData', - data: { type: 'success' } + data: { type: 'success' }, }); }, 1000); } diff --git a/src/popup/app-routing.module.ts b/src/popup/app-routing.module.ts index bd9ffa0ed3..d7faef8652 100644 --- a/src/popup/app-routing.module.ts +++ b/src/popup/app-routing.module.ts @@ -19,8 +19,8 @@ import { TwoFactorComponent } from './accounts/two-factor.component'; import { SettingsComponent } from './settings/settings.component'; import { TabsComponent } from './tabs.component'; import { ExportComponent } from './tools/export.component'; -import { PasswordGeneratorComponent } from './tools/password-generator.component'; import { PasswordGeneratorHistoryComponent } from './tools/password-generator-history.component'; +import { PasswordGeneratorComponent } from './tools/password-generator.component'; import { AddEditComponent } from './vault/add-edit.component'; import { CiphersComponent } from './vault/ciphers.component'; import { CurrentTabComponent } from './vault/current-tab.component'; @@ -161,8 +161,8 @@ const routes: Routes = [ canActivate: [AuthGuardService], data: { state: 'tabs_settings' }, }, - ] - } + ], + }, ]; @NgModule({ diff --git a/src/popup/app.component.ts b/src/popup/app.component.ts index 65f2cfe378..16103f44d5 100644 --- a/src/popup/app.component.ts +++ b/src/popup/app.component.ts @@ -51,7 +51,7 @@ export class AppComponent implements OnInit { animation: 'slideUp', limit: 2, positionClass: 'toast-bottom-full-width', - newestOnTop: false + newestOnTop: false, }); private lastActivity: number = null; @@ -110,7 +110,7 @@ export class AppComponent implements OnInit { BrowserApi.messageListener((window as any).bitwardenPopupMainMessageListener); - this.router.events.subscribe(event => { + this.router.events.subscribe((event) => { if (event instanceof NavigationEnd) { const url = event.urlAfterRedirects || event.url || ''; if (url.startsWith('/tabs/') && this.previousUrl.startsWith('/tabs/')) { diff --git a/src/popup/app.module.ts b/src/popup/app.module.ts index 8fc0307e35..25e09d9199 100644 --- a/src/popup/app.module.ts +++ b/src/popup/app.module.ts @@ -27,6 +27,7 @@ import { SettingsComponent } from './settings/settings.component'; import { TabsComponent } from './tabs.component'; import { ExportComponent } from './tools/export.component'; import { PasswordGeneratorComponent } from './tools/password-generator.component'; +// tslint:disable-next-line import { PasswordGeneratorHistoryComponent } from './tools/password-generator-history.component'; import { AddEditComponent } from './vault/add-edit.component'; import { CiphersComponent } from './vault/ciphers.component'; diff --git a/src/popup/components/ciphers-list.component.ts b/src/popup/components/ciphers-list.component.ts index b7c2049237..9ba7b4ac5f 100644 --- a/src/popup/components/ciphers-list.component.ts +++ b/src/popup/components/ciphers-list.component.ts @@ -33,8 +33,6 @@ export class CiphersListComponent { cipherType = CipherType; - constructor() { } - selectCipher(c: CipherView) { this.onSelected.emit(c); } diff --git a/src/popup/main.ts b/src/popup/main.ts index 118766ca15..2fe3813956 100644 --- a/src/popup/main.ts +++ b/src/popup/main.ts @@ -8,8 +8,8 @@ require('../scripts/duo.js'); import { AppModule } from './app.module'; -//if (!isDev()) { +// if (!isDev()) { // enableProdMode(); -//} +// } platformBrowserDynamic().bootstrapModule(AppModule); diff --git a/src/popup/services/services.module.ts b/src/popup/services/services.module.ts index c27bb61a37..d5a7057111 100644 --- a/src/popup/services/services.module.ts +++ b/src/popup/services/services.module.ts @@ -15,8 +15,8 @@ import { BrowserApi } from '../../browser/browserApi'; import { ApiService } from 'jslib/abstractions/api.service'; import { AppIdService } from 'jslib/abstractions/appId.service'; -import { AuthService as AuthServiceAbstraction } from 'jslib/abstractions/auth.service'; import { AuditService } from 'jslib/abstractions/audit.service'; +import { AuthService as AuthServiceAbstraction } from 'jslib/abstractions/auth.service'; import { CipherService } from 'jslib/abstractions/cipher.service'; import { CollectionService } from 'jslib/abstractions/collection.service'; import { CryptoService } from 'jslib/abstractions/crypto.service'; @@ -108,12 +108,12 @@ export function initFactory(i18nService: I18nService, storageService: StorageSer { provide: PlatformUtilsService, useFactory: getBgService('platformUtilsService'), - deps: [] + deps: [], }, { provide: PasswordGenerationService, useFactory: getBgService('passwordGenerationService'), - deps: [] + deps: [], }, { provide: ApiService, useFactory: getBgService('apiService'), deps: [] }, { provide: SyncService, useFactory: getBgService('syncService'), deps: [] }, diff --git a/src/popup/tools/export.component.ts b/src/popup/tools/export.component.ts index 759ce0fb3a..68e8493ab7 100644 --- a/src/popup/tools/export.component.ts +++ b/src/popup/tools/export.component.ts @@ -27,12 +27,12 @@ export class ExportComponent extends BaseExportComponent { platformUtilsService, window); } + close() { + this.location.back(); + } + protected saved() { super.saved(); this.close(); } - - close() { - this.location.back(); - } } diff --git a/src/popup/tools/password-generator-history.component.ts b/src/popup/tools/password-generator-history.component.ts index 62e4db056a..eedcd159aa 100644 --- a/src/popup/tools/password-generator-history.component.ts +++ b/src/popup/tools/password-generator-history.component.ts @@ -9,7 +9,7 @@ import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; import { - PasswordGeneratorHistoryComponent as BasePasswordGeneratorHistoryComponent + PasswordGeneratorHistoryComponent as BasePasswordGeneratorHistoryComponent, } from 'jslib/angular/components/password-generator-history.component'; @Component({ diff --git a/src/popup/tools/password-generator.component.ts b/src/popup/tools/password-generator.component.ts index 771f786f57..faf862213e 100644 --- a/src/popup/tools/password-generator.component.ts +++ b/src/popup/tools/password-generator.component.ts @@ -13,7 +13,7 @@ import { StateService } from 'jslib/abstractions/state.service'; import { CipherView } from 'jslib/models/view/cipherView'; import { - PasswordGeneratorComponent as BasePasswordGeneratorComponent + PasswordGeneratorComponent as BasePasswordGeneratorComponent, } from 'jslib/angular/components/password-generator.component'; @Component({ diff --git a/src/popup/vault/ciphers.component.ts b/src/popup/vault/ciphers.component.ts index a9cc61fda8..38459d9e8a 100644 --- a/src/popup/vault/ciphers.component.ts +++ b/src/popup/vault/ciphers.component.ts @@ -15,9 +15,9 @@ import { import { BrowserApi } from '../../browser/browserApi'; -import { FolderService } from 'jslib/abstractions/folder.service'; -import { CollectionService } from 'jslib/abstractions/collection.service'; import { CipherService } from 'jslib/abstractions/cipher.service'; +import { CollectionService } from 'jslib/abstractions/collection.service'; +import { FolderService } from 'jslib/abstractions/folder.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; import { StateService } from 'jslib/abstractions/state.service'; @@ -124,7 +124,7 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On } this.changeDetectorRef.detectChanges(); - }) + }); }); } @@ -144,7 +144,7 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On } async launchCipher(cipher: CipherView) { - if (cipher.type != CipherType.Login || !cipher.login.canLaunch) { + if (cipher.type !== CipherType.Login || !cipher.login.canLaunch) { return; } diff --git a/src/popup/vault/current-tab.component.ts b/src/popup/vault/current-tab.component.ts index da26681578..f99da8ea22 100644 --- a/src/popup/vault/current-tab.component.ts +++ b/src/popup/vault/current-tab.component.ts @@ -26,7 +26,6 @@ import { SyncService } from 'jslib/abstractions/sync.service'; import { AutofillService } from '../../services/abstractions/autofill.service'; import { PopupUtilsService } from '../services/popup-utils.service'; -import { setTimeout } from 'timers'; const BroadcasterSubscriptionId = 'CurrentTabComponent'; @@ -81,7 +80,6 @@ export class CurrentTabComponent implements OnInit, OnDestroy { } break; case 'syncCompleted': - console.log('sync complete : ' + message.successfully); if (message.successfully) { await this.load(); } @@ -91,7 +89,7 @@ export class CurrentTabComponent implements OnInit, OnDestroy { } this.changeDetectorRef.detectChanges(); - }) + }); }); if (!this.syncService.syncInProgress) { diff --git a/src/popup/vault/groupings.component.ts b/src/popup/vault/groupings.component.ts index 8e4cbe8016..55b42ed9d9 100644 --- a/src/popup/vault/groupings.component.ts +++ b/src/popup/vault/groupings.component.ts @@ -16,12 +16,12 @@ import { BrowserApi } from '../../browser/browserApi'; import { CipherType } from 'jslib/enums/cipherType'; -import { CollectionView } from 'jslib/models/view/collectionView'; import { CipherView } from 'jslib/models/view/cipherView'; +import { CollectionView } from 'jslib/models/view/collectionView'; import { FolderView } from 'jslib/models/view/folderView'; -import { CollectionService } from 'jslib/abstractions/collection.service'; import { CipherService } from 'jslib/abstractions/cipher.service'; +import { CollectionService } from 'jslib/abstractions/collection.service'; import { FolderService } from 'jslib/abstractions/folder.service'; import { StateService } from 'jslib/abstractions/state.service'; import { SyncService } from 'jslib/abstractions/sync.service'; @@ -78,7 +78,7 @@ export class GroupingsComponent extends BaseGroupingsComponent implements OnInit } this.changeDetectorRef.detectChanges(); - }) + }); }); this.route.queryParams.subscribe(async (params) => { @@ -197,7 +197,7 @@ export class GroupingsComponent extends BaseGroupingsComponent implements OnInit } async launchCipher(cipher: CipherView) { - if (cipher.type != CipherType.Login || !cipher.login.canLaunch) { + if (cipher.type !== CipherType.Login || !cipher.login.canLaunch) { return; } diff --git a/src/services/browserPlatformUtils.service.ts b/src/services/browserPlatformUtils.service.ts index 3f45ca97bf..e0587f93a0 100644 --- a/src/services/browserPlatformUtils.service.ts +++ b/src/services/browserPlatformUtils.service.ts @@ -4,8 +4,8 @@ import { BrowserApi } from '../browser/browserApi'; import { DeviceType } from 'jslib/enums/deviceType'; -import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; import { MessagingService } from 'jslib/abstractions/messaging.service'; +import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; import { UtilsService } from 'jslib/services/utils.service';