Skip to content

Commit

Permalink
bumped eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Aug 25, 2023
1 parent 4684b0d commit 1b0ce6d
Show file tree
Hide file tree
Showing 21 changed files with 540 additions and 331 deletions.
14 changes: 12 additions & 2 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
settings:
import/parsers:
'@typescript-eslint/parser': ['.ts']
import/resolver:
typescript: true
typescript:
project:
- tsconfig.json
- tabby-*/tsconfig.json
node: true

env:
browser: true
es6: true
Expand All @@ -28,7 +34,7 @@ overrides:
- plugin:import/typescript
plugins:
- '@typescript-eslint'
- 'import'
- import
rules:
'@typescript-eslint/semi':
- error
Expand Down Expand Up @@ -130,6 +136,7 @@ overrides:
'@typescript-eslint/naming-convention': off
'@typescript-eslint/lines-between-class-members':
- error
- always
- exceptAfterSingleLine: true
'@typescript-eslint/dot-notation': off
'@typescript-eslint/no-implicit-any-catch': off
Expand All @@ -152,3 +159,6 @@ overrides:
'@typescript-eslint/consistent-generic-constructors': off
'keyword-spacing': off
'@typescript-eslint/keyword-spacing': off
'@typescript-eslint/class-methods-use-this': off
'@typescript-eslint/lines-around-comment': off
'@typescript-eslint/no-redundant-type-constituents': off # broken
2 changes: 1 addition & 1 deletion app/lib/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export class Application {
}

enableTray (): void {
if (this.tray || process.platform === 'linux') {
if (!!this.tray || process.platform === 'linux') {
return
}
if (process.platform === 'darwin') {
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"@types/js-yaml": "^4.0.5",
"@types/node": "20.3.1",
"@types/webpack-env": "^1.18.0",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.54.1",
"@typescript-eslint/eslint-plugin": "^6.4.1",
"@typescript-eslint/parser": "^6.4.1",
"apply-loader": "2.0.0",
"axios": "^1.4.0",
"babel-loader": "^9.1.2",
Expand All @@ -44,9 +44,9 @@
"electron-download": "^4.1.1",
"electron-installer-snap": "^5.1.0",
"electron-rebuild": "^3.2.9",
"eslint": "^8.38.0",
"eslint-import-resolver-typescript": "^3.5.2",
"eslint-plugin-import": "^2.27.5",
"eslint": "^8.48.0",
"eslint-import-resolver-typescript": "^3.6.0",
"eslint-plugin-import": "^2.28.1",
"file-loader": "^6.2.0",
"gettext-extractor": "^3.8.0",
"graceful-fs": "^4.2.10",
Expand Down
2 changes: 1 addition & 1 deletion tabby-core/src/api/menu.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export interface MenuItemOptions {
type?: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio')
type?: 'normal' | 'separator' | 'submenu' | 'checkbox' | 'radio'
label?: string
sublabel?: string
enabled?: boolean
Expand Down
1 change: 1 addition & 0 deletions tabby-core/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ export class CoreConfigProvider extends ConfigProvider {
[Platform.Linux]: require('./configDefaults.linux.yaml').default,
[Platform.Web]: require('./configDefaults.web.yaml').default,
}

defaults = require('./configDefaults.yaml').default
}
6 changes: 3 additions & 3 deletions tabby-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ export default class AppModule { // eslint-disable-line @typescript-eslint/no-ex
if (!provider) {
return
}
this.showSelector(provider)
this.showSelector(provider).catch(() => null)
}
if (hotkey === 'command-selector') {
commands.showSelector().catch(() => {return})
commands.showSelector().catch(() => null)
}

if (hotkey === 'profile-selector') {
Expand Down Expand Up @@ -229,7 +229,7 @@ export default class AppModule { // eslint-disable-line @typescript-eslint/no-ex
})
}

await this.selector.show(this.translate.instant('Select profile'), options).catch(() => {return})
await this.selector.show(this.translate.instant('Select profile'), options)
}

static forRoot (): ModuleWithProviders<AppModule> {
Expand Down
2 changes: 1 addition & 1 deletion tabby-core/src/services/commands.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,6 @@ export class CommandService {
description: c.sublabel,
icon: c.icon,
})),
).then(() => {return})
)
}
}
1 change: 1 addition & 0 deletions tabby-electron/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ export class ElectronConfigProvider extends ConfigProvider {
},
},
}

defaults = {}
}
1 change: 1 addition & 0 deletions tabby-electron/src/services/shellIntegration.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export class ShellIntegrationService {
command: 'paste "%V"',
},
]

private constructor (
private electron: ElectronService,
private hostApp: HostAppService,
Expand Down
2 changes: 1 addition & 1 deletion tabby-plugin-manager/src/services/pluginManager.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class PluginManagerService {
map(plugins => plugins.filter(x => x.packageName.startsWith(namePrefix))),
map(plugins => plugins.filter(x => !PLUGIN_BLACKLIST.includes(x.packageName))),
map(plugins => {
const mapping: Record<string, PluginInfo[]> = {}
const mapping: Record<string, PluginInfo[]|undefined> = {}
for (const p of plugins) {
mapping[p.name] ??= []
mapping[p.name].push(p)

Check failure on line 74 in tabby-plugin-manager/src/services/pluginManager.service.ts

View workflow job for this annotation

GitHub Actions / build

Object is possibly 'undefined'.

Check failure on line 74 in tabby-plugin-manager/src/services/pluginManager.service.ts

View workflow job for this annotation

GitHub Actions / Lint

Object is possibly 'undefined'.

Check failure on line 74 in tabby-plugin-manager/src/services/pluginManager.service.ts

View workflow job for this annotation

GitHub Actions / Windows-Build (x64)

Object is possibly 'undefined'.

Check failure on line 74 in tabby-plugin-manager/src/services/pluginManager.service.ts

View workflow job for this annotation

GitHub Actions / Windows-Build (arm64)

Object is possibly 'undefined'.

Check failure on line 74 in tabby-plugin-manager/src/services/pluginManager.service.ts

View workflow job for this annotation

GitHub Actions / macOS-Build (x86_64)

Object is possibly 'undefined'.

Check failure on line 74 in tabby-plugin-manager/src/services/pluginManager.service.ts

View workflow job for this annotation

GitHub Actions / macOS-Build (arm64)

Object is possibly 'undefined'.

Check failure on line 74 in tabby-plugin-manager/src/services/pluginManager.service.ts

View workflow job for this annotation

GitHub Actions / Linux-Build (x64, amd64)

Object is possibly 'undefined'.
Expand Down
1 change: 1 addition & 0 deletions tabby-settings/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export class SettingsConfigProvider extends ConfigProvider {
},
},
}

platformDefaults = {
[Platform.macOS]: {
hotkeys: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export class SFTPCreateDirectoryModalComponent extends BaseComponent {
create (): void {
this.modalInstance.close(this.directoryName)
}

cancel (): void {
this.modalInstance.close('')
}
Expand Down
1 change: 0 additions & 1 deletion tabby-ssh/src/session/sftp.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as C from 'constants'
// eslint-disable-next-line @typescript-eslint/no-duplicate-imports, no-duplicate-imports
import { Subject, Observable } from 'rxjs'
import { posix as posixPath } from 'path'
import { Injector, NgZone } from '@angular/core'
Expand Down
1 change: 0 additions & 1 deletion tabby-ssh/src/session/ssh.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as fs from 'mz/fs'
import * as crypto from 'crypto'
// eslint-disable-next-line @typescript-eslint/no-duplicate-imports, no-duplicate-imports
import * as sshpk from 'sshpk'
import colors from 'ansi-colors'
import stripAnsi from 'strip-ansi'
Expand Down
4 changes: 2 additions & 2 deletions tabby-ssh/src/session/x11.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class X11Socket {

static resolveDisplaySpec (spec?: string|null): SocketConnectOpts {
// eslint-disable-next-line prefer-const, @typescript-eslint/no-unused-vars
let [_, xHost, xDisplay] = /^(.+):(\d+)(?:.(\d+))$/.exec(spec ?? process.env.DISPLAY ?? 'localhost:0') ?? []
let [_, xHost, xDisplay] = /^(.+):(\d+)(?:.(\d+))$/.exec(spec ?? process.env.DISPLAY ?? 'localhost:0') ?? [undefined, undefined, undefined]
if (process.platform === 'win32') {
xHost ??= 'localhost'
} else {
Expand All @@ -18,7 +18,7 @@ export class X11Socket {
xHost = spec
}

const display = parseInt(xDisplay || '0')
const display = parseInt(xDisplay ?? '0')
const port = display < 100 ? display + 6000 : display

if (xHost === 'unix') {
Expand Down
2 changes: 1 addition & 1 deletion tabby-ssh/src/sftpContextMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ export class CommonSFTPContextMenu extends SFTPContextMenuItemProvider {
const modal = this.ngbModal.open(SFTPDeleteModalComponent)
modal.componentInstance.item = item
modal.componentInstance.sftp = session
await modal.result.catch(() => {return})
await modal.result.catch(() => null)
}
}
1 change: 1 addition & 0 deletions tabby-telnet/src/session.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */
import { Socket } from 'net'
import colors from 'ansi-colors'
import stripAnsi from 'strip-ansi'
Expand Down
2 changes: 2 additions & 0 deletions tabby-terminal/src/api/baseTerminalTab.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,13 @@ export class BaseTerminalTabComponent<P extends BaseTerminalProfile> extends Bas
},
},
})

private spinnerActive = false
private spinnerPaused = false
private toolbarRevealTimeout = new ResettableTimeout(() => {
this.revealToolbar = false
}, 1000)

private frontendWriteLock = Promise.resolve()

get input$ (): Observable<Buffer> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export class StreamProcessingSettingsComponent {
description: _('Send bytes by typing in hex values'),
},
]

outputModes = [
{
key: null,
Expand All @@ -45,6 +46,7 @@ export class StreamProcessingSettingsComponent {
description: _('Output is shown as a hexdump'),
},
]

newlineModes = [
{ key: null, name: _('Keep') },
{ key: 'strip', name: _('Strip') },
Expand Down
1 change: 1 addition & 0 deletions tabby-terminal/src/services/multifocus.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export class MultifocusService {
return
}
const tabs = currentTab.getAllTabs().filter(t => t instanceof BaseTerminalTabComponent)
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
this.start(pane, tabs as any)
}
}
Loading

0 comments on commit 1b0ce6d

Please sign in to comment.