lint & enabled linter on Azure pipelines

This commit is contained in:
Eugene Pankov
2019-07-24 11:24:57 +02:00
parent b6aa1f764b
commit dc9508f80d
13 changed files with 34 additions and 31 deletions

View File

@@ -128,8 +128,8 @@ export class AppRootComponent {
})
this.hostApp.windowCloseRequest$.subscribe(async () => {
await this.app.closeAllTabs() && this.hostApp.closeWindow();
});
await this.app.closeAllTabs() && this.hostApp.closeWindow()
})
if (window['safeModeReason']) {
ngbModal.open(SafeModeModalComponent)

View File

@@ -10,7 +10,7 @@ import { AppService } from '../services/app.service'
import { HostAppService, Platform } from '../services/hostApp.service'
/** @hidden */
export interface ISortableComponent {
export interface SortableComponentProxy {
setDragHandle (_: HTMLElement)
}
@@ -34,7 +34,7 @@ export class TabHeaderComponent {
private hostApp: HostAppService,
private ngbModal: NgbModal,
private hotkeys: HotkeysService,
@Inject(SortableComponent) private parentDraggable: ISortableComponent,
@Inject(SortableComponent) private parentDraggable: SortableComponentProxy,
@Optional() @Inject(TabContextMenuItemProvider) protected contextMenuProviders: TabContextMenuItemProvider[],
) {
this.hotkeys.matchedHotkey.subscribe((hotkey) => {

View File

@@ -209,16 +209,16 @@ export class AppService {
/**
* Attempts to close all tabs, returns false if one of the tabs blocked closure
*/
async closeAllTabs () : Promise<boolean> {
async closeAllTabs (): Promise<boolean> {
for (const tab of this.tabs) {
if (!await tab.canClose()) {
return false;
return false
}
}
for (const tab of this.tabs) {
tab.destroy()
}
return true;
return true
}
/** @hidden */

View File

@@ -71,8 +71,8 @@ export class ConfigProxy {
}
}
getValue (_key: string): any { }
setValue (_key: string, _value: any) { }
getValue (_key: string): any { } // eslint-disable-line @typescript-eslint/no-empty-function
setValue (_key: string, _value: any) { } // eslint-disable-line @typescript-eslint/no-empty-function
}
@Injectable({ providedIn: 'root' })

View File

@@ -30,8 +30,8 @@ export class DockingService {
}
const newBounds: Bounds = { x: 0, y: 0, width: 0, height: 0 }
const fill = this.config.store.appearance.dockFill <= 1 ? this.config.store.appearance.dockFill : 1;
const fill = this.config.store.appearance.dockFill <= 1 ? this.config.store.appearance.dockFill : 1
const [minWidth, minHeight] = this.hostApp.getWindow().getMinimumSize()
if (dockSide === 'left' || dockSide === 'right') {
@@ -64,15 +64,15 @@ export class DockingService {
}
getScreens () {
const primaryDisplayID = this.electron.screen.getPrimaryDisplay().id;
return this.electron.screen.getAllDisplays().sort((a,b) => (
const primaryDisplayID = this.electron.screen.getPrimaryDisplay().id
return this.electron.screen.getAllDisplays().sort((a, b) =>
a.bounds.x === b.bounds.x ? a.bounds.y - b.bounds.y : a.bounds.x - b.bounds.x
)).map((display,index) => {
).map((display,index) => {
return {
id: display.id,
name: display.id === primaryDisplayID ? 'Primary Display' : `Display ${index +1}`,
}
});
})
}
private repositionWindow () {

View File

@@ -29,7 +29,7 @@ export class UpdaterService {
this.autoUpdater = electron.remote.require('electron-updater').autoUpdater
this.autoUpdater.autoInstallOnAppQuit = !!config.store.enableAutomaticUpdates;
this.autoUpdater.autoInstallOnAppQuit = !!config.store.enableAutomaticUpdates
this.autoUpdater.on('update-available', () => {
this.logger.info('Update available')
@@ -76,20 +76,19 @@ export class UpdaterService {
this.electron.shell.openExternal(this.updateURL)
} else {
if (process.platform === 'win32') {
let downloadpath = await this.autoUpdater.downloadUpdate();
let downloadpath = await this.autoUpdater.downloadUpdate()
fs.exists(downloadpath[0], (exists) => {
if (exists) {
fs.copyFile(downloadpath[0], os.tmpdir() + 'terminus-installer-temp.exe', (err) => {
if (!err) {
spawn(os.tmpdir() + 'terminus-installer-temp.exe', ['--force-run'], {detached: true, stdio: 'ignore'});
spawn(os.tmpdir() + 'terminus-installer-temp.exe', ['--force-run'], { detached: true, stdio: 'ignore' })
}
});
})
}
})
} else {
await this.downloaded;
this.autoUpdater.quitAndInstall(false, true);
await this.downloaded
this.autoUpdater.quitAndInstall(false, true)
}
}
}