mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-05 02:50:00 +00:00
lint
This commit is contained in:
parent
10ae6ffd99
commit
bc7a537c4c
@ -111,7 +111,6 @@ rules:
|
|||||||
'@typescript-eslint/lines-between-class-members':
|
'@typescript-eslint/lines-between-class-members':
|
||||||
- error
|
- error
|
||||||
- exceptAfterSingleLine: true
|
- exceptAfterSingleLine: true
|
||||||
'@typescript-eslint/non-nullable-type-assertion-style': off
|
|
||||||
'@typescript-eslint/dot-notation': off
|
'@typescript-eslint/dot-notation': off
|
||||||
'@typescript-eslint/no-confusing-void-expression': off
|
'@typescript-eslint/no-confusing-void-expression': off
|
||||||
'@typescript-eslint/no-implicit-any-catch': off
|
'@typescript-eslint/no-implicit-any-catch': off
|
||||||
|
@ -173,8 +173,8 @@ export async function loadPlugins (foundPlugins: PluginInfo[], progress: Progres
|
|||||||
console.time(label)
|
console.time(label)
|
||||||
const packageModule = nodeRequire(foundPlugin.path)
|
const packageModule = nodeRequire(foundPlugin.path)
|
||||||
const pluginModule = packageModule.default.forRoot ? packageModule.default.forRoot() : packageModule.default
|
const pluginModule = packageModule.default.forRoot ? packageModule.default.forRoot() : packageModule.default
|
||||||
pluginModule['pluginName'] = foundPlugin.name
|
pluginModule.pluginName = foundPlugin.name
|
||||||
pluginModule['bootstrap'] = packageModule.bootstrap
|
pluginModule.bootstrap = packageModule.bootstrap
|
||||||
plugins.push(pluginModule)
|
plugins.push(pluginModule)
|
||||||
console.timeEnd(label)
|
console.timeEnd(label)
|
||||||
await new Promise(x => setTimeout(x, 50))
|
await new Promise(x => setTimeout(x, 50))
|
||||||
|
@ -194,10 +194,10 @@ export class ConfigService {
|
|||||||
this.servicesCache = {}
|
this.servicesCache = {}
|
||||||
const ngModule = window['rootModule'].ɵinj
|
const ngModule = window['rootModule'].ɵinj
|
||||||
for (const imp of ngModule.imports) {
|
for (const imp of ngModule.imports) {
|
||||||
const module = imp['ngModule'] || imp
|
const module = imp.ngModule || imp
|
||||||
if (module.ɵinj?.providers) {
|
if (module.ɵinj?.providers) {
|
||||||
this.servicesCache[module['pluginName']] = module.ɵinj.providers.map(provider => {
|
this.servicesCache[module.pluginName] = module.ɵinj.providers.map(provider => {
|
||||||
return provider['useClass'] || provider
|
return provider.useClass || provider
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ export class ShellIntegrationService {
|
|||||||
'extras',
|
'extras',
|
||||||
'automator-workflows',
|
'automator-workflows',
|
||||||
)
|
)
|
||||||
this.automatorWorkflowsDestination = path.join(process.env.HOME as string, 'Library', 'Services')
|
this.automatorWorkflowsDestination = path.join(process.env.HOME!, 'Library', 'Services')
|
||||||
}
|
}
|
||||||
this.updatePaths()
|
this.updatePaths()
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,8 @@ export class RecoveryProvider extends TabRecoveryProvider {
|
|||||||
return {
|
return {
|
||||||
type: SerialTabComponent,
|
type: SerialTabComponent,
|
||||||
options: {
|
options: {
|
||||||
connection: recoveryToken['connection'],
|
connection: recoveryToken.connection,
|
||||||
savedState: recoveryToken['savedState'],
|
savedState: recoveryToken.savedState,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,7 @@ export class SettingsTabComponent extends BaseTabComponent {
|
|||||||
|
|
||||||
hotkeyFilterFn (hotkey: HotkeyDescription, query: string): boolean {
|
hotkeyFilterFn (hotkey: HotkeyDescription, query: string): boolean {
|
||||||
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
// 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())
|
return s.toLowerCase().includes(query.toLowerCase())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ export class SSHService {
|
|||||||
let privateKeyPath = session.connection.privateKey
|
let privateKeyPath = session.connection.privateKey
|
||||||
|
|
||||||
if (!privateKeyPath) {
|
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)) {
|
if (await fs.exists(userKeyPath)) {
|
||||||
logCallback?.('Using user\'s default private key')
|
logCallback?.('Using user\'s default private key')
|
||||||
privateKeyPath = userKeyPath
|
privateKeyPath = userKeyPath
|
||||||
@ -219,7 +219,7 @@ export class SSHService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
agent = process.env.SSH_AUTH_SOCK as string
|
agent = process.env.SSH_AUTH_SOCK!
|
||||||
}
|
}
|
||||||
|
|
||||||
const authMethodsLeft = ['none']
|
const authMethodsLeft = ['none']
|
||||||
|
@ -319,7 +319,7 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
|
|||||||
}
|
}
|
||||||
|
|
||||||
async paste (): Promise<void> {
|
async paste (): Promise<void> {
|
||||||
let data = this.electron.clipboard.readText() as string
|
let data = this.electron.clipboard.readText()
|
||||||
if (this.config.store.terminal.bracketedPaste) {
|
if (this.config.store.terminal.bracketedPaste) {
|
||||||
data = '\x1b[200~' + data + '\x1b[201~'
|
data = '\x1b[200~' + data + '\x1b[201~'
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ import { TerminalColorScheme } from './api/interfaces'
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class HyperColorSchemes extends TerminalColorSchemeProvider {
|
export class HyperColorSchemes extends TerminalColorSchemeProvider {
|
||||||
async getSchemes (): Promise<TerminalColorScheme[]> {
|
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)) {
|
if (!await fs.exists(pluginsPath)) {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
@ -153,8 +153,8 @@ export class XTermFrontend extends Frontend {
|
|||||||
host.addEventListener('dragOver', (event: any) => this.dragOver.next(event))
|
host.addEventListener('dragOver', (event: any) => this.dragOver.next(event))
|
||||||
host.addEventListener('drop', event => this.drop.next(event))
|
host.addEventListener('drop', event => this.drop.next(event))
|
||||||
|
|
||||||
host.addEventListener('mousedown', event => this.mouseEvent.next(event as MouseEvent))
|
host.addEventListener('mousedown', event => this.mouseEvent.next(event))
|
||||||
host.addEventListener('mouseup', event => this.mouseEvent.next(event as MouseEvent))
|
host.addEventListener('mouseup', event => this.mouseEvent.next(event))
|
||||||
host.addEventListener('mousewheel', event => this.mouseEvent.next(event as MouseEvent))
|
host.addEventListener('mousewheel', event => this.mouseEvent.next(event as MouseEvent))
|
||||||
|
|
||||||
const ro = new window['ResizeObserver'](() => setTimeout(() => this.resizeHandler()))
|
const ro = new window['ResizeObserver'](() => setTimeout(() => this.resizeHandler()))
|
||||||
|
@ -11,8 +11,8 @@ export class RecoveryProvider extends TabRecoveryProvider {
|
|||||||
return {
|
return {
|
||||||
type: TerminalTabComponent,
|
type: TerminalTabComponent,
|
||||||
options: {
|
options: {
|
||||||
sessionOptions: recoveryToken['sessionOptions'],
|
sessionOptions: recoveryToken.sessionOptions,
|
||||||
savedState: recoveryToken['savedState'],
|
savedState: recoveryToken.savedState,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ export class WSLShellProvider extends ShellProvider {
|
|||||||
return [{
|
return [{
|
||||||
id: 'wsl',
|
id: 'wsl',
|
||||||
name: 'WSL / Bash on Windows',
|
name: 'WSL / Bash on Windows',
|
||||||
icon: wslIconMap['Linux'],
|
icon: wslIconMap.Linux,
|
||||||
command: bashPath,
|
command: bashPath,
|
||||||
env: {
|
env: {
|
||||||
TERM: 'xterm-color',
|
TERM: 'xterm-color',
|
||||||
|
@ -107,7 +107,7 @@ export class NewTabContextMenu extends TabContextMenuItemProvider {
|
|||||||
label: 'Duplicate as administrator',
|
label: 'Duplicate as administrator',
|
||||||
click: () => this.zone.run(async () => {
|
click: () => this.zone.run(async () => {
|
||||||
this.terminalService.openTabWithOptions({
|
this.terminalService.openTabWithOptions({
|
||||||
...(tab as TerminalTabComponent).sessionOptions,
|
...tab.sessionOptions,
|
||||||
runAsAdministrator: true,
|
runAsAdministrator: true,
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
@ -150,7 +150,7 @@ export class CopyPasteContextMenu extends TabContextMenuItemProvider {
|
|||||||
click: (): void => {
|
click: (): void => {
|
||||||
this.zone.run(() => {
|
this.zone.run(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
(tab as BaseTerminalTabComponent).frontend.copySelection()
|
tab.frontend.copySelection()
|
||||||
this.toastr.info('Copied')
|
this.toastr.info('Copied')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -159,7 +159,7 @@ export class CopyPasteContextMenu extends TabContextMenuItemProvider {
|
|||||||
{
|
{
|
||||||
label: 'Paste',
|
label: 'Paste',
|
||||||
click: (): void => {
|
click: (): void => {
|
||||||
this.zone.run(() => (tab as BaseTerminalTabComponent).paste())
|
this.zone.run(() => tab.paste())
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user