From 73e25ed099b0b97b2295059d32b356dd9f9dcc74 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Mon, 5 Dec 2022 14:52:23 +0100 Subject: [PATCH] lint --- .eslintrc.yml | 1 + app/lib/app.ts | 4 ++-- app/lib/config.ts | 2 +- app/lib/window.ts | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.eslintrc.yml b/.eslintrc.yml index 0c6fb2e6..551f906e 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -141,3 +141,4 @@ rules: '@typescript-eslint/consistent-type-exports': off '@typescript-eslint/consistent-generic-constructors': off 'keyword-spacing': off + '@typescript-eslint/keyword-spacing': off diff --git a/app/lib/app.ts b/app/lib/app.ts index 5a0e3c48..9de60e42 100644 --- a/app/lib/app.ts +++ b/app/lib/app.ts @@ -65,7 +65,7 @@ export class Application { if (process.platform === 'linux') { app.commandLine.appendSwitch('no-sandbox') - if (((this.configStore.appearance || {}).opacity || 1) !== 1) { + if ((this.configStore.appearance?.opacity || 1) !== 1) { app.commandLine.appendSwitch('enable-transparent-visuals') app.disableHardwareAcceleration() } @@ -112,7 +112,7 @@ export class Application { async newWindow (options?: WindowOptions): Promise { const window = new Window(this, this.configStore, options) this.windows.push(window) - if (this.windows.length === 1){ + if (this.windows.length === 1) { window.makeMain() } window.visible$.subscribe(visible => { diff --git a/app/lib/config.ts b/app/lib/config.ts index 9a45f056..ef86d0a9 100644 --- a/app/lib/config.ts +++ b/app/lib/config.ts @@ -1,4 +1,4 @@ -import * as fs from 'mz/fs' +import * as fs from 'fs' import * as path from 'path' import * as yaml from 'js-yaml' import { app } from 'electron' diff --git a/app/lib/window.ts b/app/lib/window.ts index 6b176007..a9fb3028 100644 --- a/app/lib/window.ts +++ b/app/lib/window.ts @@ -89,7 +89,7 @@ export class Window { } } - if ((this.configStore.appearance || {}).frame === 'native') { + if (this.configStore.appearance?.frame === 'native') { bwOptions.frame = true } else { if (process.platform === 'darwin') { @@ -108,7 +108,7 @@ export class Window { this.window.once('ready-to-show', () => { if (process.platform === 'darwin') { this.window.setVibrancy(macOSVibrancyType) - } else if (process.platform === 'win32' && (this.configStore.appearance || {}).vibrancy) { + } else if (process.platform === 'win32' && this.configStore.appearance?.vibrancy) { this.setVibrancy(true) }