mirror of
https://github.com/Eugeny/tabby.git
synced 2025-02-17 14:49:39 +08:00
lint
This commit is contained in:
parent
10ae6ffd99
commit
bc7a537c4c
@ -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
|
||||
|
@ -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))
|
||||
|
@ -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
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
@ -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']
|
||||
|
@ -319,7 +319,7 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
|
||||
}
|
||||
|
||||
async paste (): Promise<void> {
|
||||
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~'
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import { TerminalColorScheme } from './api/interfaces'
|
||||
@Injectable()
|
||||
export class HyperColorSchemes extends TerminalColorSchemeProvider {
|
||||
async getSchemes (): Promise<TerminalColorScheme[]> {
|
||||
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 []
|
||||
}
|
||||
|
@ -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()))
|
||||
|
@ -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,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -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',
|
||||
|
@ -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())
|
||||
},
|
||||
},
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user