diff --git a/.eslintrc.yml b/.eslintrc.yml index c1a04346..cf07a4ea 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -111,7 +111,6 @@ rules: '@typescript-eslint/lines-between-class-members': - error - exceptAfterSingleLine: true - '@typescript-eslint/non-nullable-type-assertion-style': off '@typescript-eslint/dot-notation': off '@typescript-eslint/no-confusing-void-expression': off '@typescript-eslint/no-implicit-any-catch': off diff --git a/app/src/plugins.ts b/app/src/plugins.ts index 3ab58ec5..6b0a0e80 100644 --- a/app/src/plugins.ts +++ b/app/src/plugins.ts @@ -173,8 +173,8 @@ export async function loadPlugins (foundPlugins: PluginInfo[], progress: Progres console.time(label) const packageModule = nodeRequire(foundPlugin.path) const pluginModule = packageModule.default.forRoot ? packageModule.default.forRoot() : packageModule.default - pluginModule['pluginName'] = foundPlugin.name - pluginModule['bootstrap'] = packageModule.bootstrap + pluginModule.pluginName = foundPlugin.name + pluginModule.bootstrap = packageModule.bootstrap plugins.push(pluginModule) console.timeEnd(label) await new Promise(x => setTimeout(x, 50)) diff --git a/terminus-core/src/services/config.service.ts b/terminus-core/src/services/config.service.ts index ae87dbcb..0c7ca07f 100644 --- a/terminus-core/src/services/config.service.ts +++ b/terminus-core/src/services/config.service.ts @@ -194,10 +194,10 @@ export class ConfigService { this.servicesCache = {} const ngModule = window['rootModule'].ɵinj for (const imp of ngModule.imports) { - const module = imp['ngModule'] || imp + const module = imp.ngModule || imp if (module.ɵinj?.providers) { - this.servicesCache[module['pluginName']] = module.ɵinj.providers.map(provider => { - return provider['useClass'] || provider + this.servicesCache[module.pluginName] = module.ɵinj.providers.map(provider => { + return provider.useClass || provider }) } } diff --git a/terminus-core/src/services/shellIntegration.service.ts b/terminus-core/src/services/shellIntegration.service.ts index b0bf9a90..923cbddf 100644 --- a/terminus-core/src/services/shellIntegration.service.ts +++ b/terminus-core/src/services/shellIntegration.service.ts @@ -44,7 +44,7 @@ export class ShellIntegrationService { 'extras', 'automator-workflows', ) - this.automatorWorkflowsDestination = path.join(process.env.HOME as string, 'Library', 'Services') + this.automatorWorkflowsDestination = path.join(process.env.HOME!, 'Library', 'Services') } this.updatePaths() } diff --git a/terminus-serial/src/recoveryProvider.ts b/terminus-serial/src/recoveryProvider.ts index 42ed3c77..78fdfc3e 100644 --- a/terminus-serial/src/recoveryProvider.ts +++ b/terminus-serial/src/recoveryProvider.ts @@ -11,8 +11,8 @@ export class RecoveryProvider extends TabRecoveryProvider { return { type: SerialTabComponent, options: { - connection: recoveryToken['connection'], - savedState: recoveryToken['savedState'], + connection: recoveryToken.connection, + savedState: recoveryToken.savedState, }, } } diff --git a/terminus-settings/src/components/settingsTab.component.ts b/terminus-settings/src/components/settingsTab.component.ts index b7f25177..d0284369 100644 --- a/terminus-settings/src/components/settingsTab.component.ts +++ b/terminus-settings/src/components/settingsTab.component.ts @@ -143,7 +143,7 @@ export class SettingsTabComponent extends BaseTabComponent { hotkeyFilterFn (hotkey: HotkeyDescription, query: string): boolean { // eslint-disable-next-line @typescript-eslint/restrict-plus-operands - const s = hotkey.name + (this.getHotkey(hotkey.id) || []).toString() as string + const s = hotkey.name + (this.getHotkey(hotkey.id) || []).toString() return s.toLowerCase().includes(query.toLowerCase()) } } diff --git a/terminus-ssh/src/services/ssh.service.ts b/terminus-ssh/src/services/ssh.service.ts index cfcc9eae..eb678db0 100644 --- a/terminus-ssh/src/services/ssh.service.ts +++ b/terminus-ssh/src/services/ssh.service.ts @@ -57,7 +57,7 @@ export class SSHService { let privateKeyPath = session.connection.privateKey if (!privateKeyPath) { - const userKeyPath = path.join(process.env.HOME as string, '.ssh', 'id_rsa') + const userKeyPath = path.join(process.env.HOME!, '.ssh', 'id_rsa') if (await fs.exists(userKeyPath)) { logCallback?.('Using user\'s default private key') privateKeyPath = userKeyPath @@ -219,7 +219,7 @@ export class SSHService { } } } else { - agent = process.env.SSH_AUTH_SOCK as string + agent = process.env.SSH_AUTH_SOCK! } const authMethodsLeft = ['none'] diff --git a/terminus-terminal/src/api/baseTerminalTab.component.ts b/terminus-terminal/src/api/baseTerminalTab.component.ts index 68e2b56e..2dc6d2a2 100644 --- a/terminus-terminal/src/api/baseTerminalTab.component.ts +++ b/terminus-terminal/src/api/baseTerminalTab.component.ts @@ -319,7 +319,7 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit } async paste (): Promise { - let data = this.electron.clipboard.readText() as string + let data = this.electron.clipboard.readText() if (this.config.store.terminal.bracketedPaste) { data = '\x1b[200~' + data + '\x1b[201~' } diff --git a/terminus-terminal/src/colorSchemes.ts b/terminus-terminal/src/colorSchemes.ts index 0dcc9275..fa64658d 100644 --- a/terminus-terminal/src/colorSchemes.ts +++ b/terminus-terminal/src/colorSchemes.ts @@ -8,7 +8,7 @@ import { TerminalColorScheme } from './api/interfaces' @Injectable() export class HyperColorSchemes extends TerminalColorSchemeProvider { async getSchemes (): Promise { - const pluginsPath = path.join(process.env.HOME as string, '.hyper_plugins', 'node_modules') + const pluginsPath = path.join(process.env.HOME!, '.hyper_plugins', 'node_modules') if (!await fs.exists(pluginsPath)) { return [] } diff --git a/terminus-terminal/src/frontends/xtermFrontend.ts b/terminus-terminal/src/frontends/xtermFrontend.ts index 7b692ef6..eb1bb89a 100644 --- a/terminus-terminal/src/frontends/xtermFrontend.ts +++ b/terminus-terminal/src/frontends/xtermFrontend.ts @@ -153,8 +153,8 @@ export class XTermFrontend extends Frontend { host.addEventListener('dragOver', (event: any) => this.dragOver.next(event)) host.addEventListener('drop', event => this.drop.next(event)) - host.addEventListener('mousedown', event => this.mouseEvent.next(event as MouseEvent)) - host.addEventListener('mouseup', event => this.mouseEvent.next(event as MouseEvent)) + host.addEventListener('mousedown', event => this.mouseEvent.next(event)) + host.addEventListener('mouseup', event => this.mouseEvent.next(event)) host.addEventListener('mousewheel', event => this.mouseEvent.next(event as MouseEvent)) const ro = new window['ResizeObserver'](() => setTimeout(() => this.resizeHandler())) diff --git a/terminus-terminal/src/recoveryProvider.ts b/terminus-terminal/src/recoveryProvider.ts index fc6b839a..281ffd4c 100644 --- a/terminus-terminal/src/recoveryProvider.ts +++ b/terminus-terminal/src/recoveryProvider.ts @@ -11,8 +11,8 @@ export class RecoveryProvider extends TabRecoveryProvider { return { type: TerminalTabComponent, options: { - sessionOptions: recoveryToken['sessionOptions'], - savedState: recoveryToken['savedState'], + sessionOptions: recoveryToken.sessionOptions, + savedState: recoveryToken.savedState, }, } } diff --git a/terminus-terminal/src/shells/wsl.ts b/terminus-terminal/src/shells/wsl.ts index 063d0836..65b172c4 100644 --- a/terminus-terminal/src/shells/wsl.ts +++ b/terminus-terminal/src/shells/wsl.ts @@ -72,7 +72,7 @@ export class WSLShellProvider extends ShellProvider { return [{ id: 'wsl', name: 'WSL / Bash on Windows', - icon: wslIconMap['Linux'], + icon: wslIconMap.Linux, command: bashPath, env: { TERM: 'xterm-color', diff --git a/terminus-terminal/src/tabContextMenu.ts b/terminus-terminal/src/tabContextMenu.ts index bd30d016..07fd16c2 100644 --- a/terminus-terminal/src/tabContextMenu.ts +++ b/terminus-terminal/src/tabContextMenu.ts @@ -107,7 +107,7 @@ export class NewTabContextMenu extends TabContextMenuItemProvider { label: 'Duplicate as administrator', click: () => this.zone.run(async () => { this.terminalService.openTabWithOptions({ - ...(tab as TerminalTabComponent).sessionOptions, + ...tab.sessionOptions, runAsAdministrator: true, }) }), @@ -150,7 +150,7 @@ export class CopyPasteContextMenu extends TabContextMenuItemProvider { click: (): void => { this.zone.run(() => { setTimeout(() => { - (tab as BaseTerminalTabComponent).frontend.copySelection() + tab.frontend.copySelection() this.toastr.info('Copied') }) }) @@ -159,7 +159,7 @@ export class CopyPasteContextMenu extends TabContextMenuItemProvider { { label: 'Paste', click: (): void => { - this.zone.run(() => (tab as BaseTerminalTabComponent).paste()) + this.zone.run(() => tab.paste()) }, }, ]