Browse Source

allow type aliases

Eugene Pankov 4 years ago
parent
commit
f7b0272be5

+ 1 - 0
.eslintrc.yml

@@ -125,3 +125,4 @@ rules:
   - error
   - allowAliases: in-unions-and-intersections
     allowLiterals: always
+    allowCallbacks: always

+ 1 - 1
app/src/plugins.ts

@@ -58,7 +58,7 @@ nodeModule.prototype.require = function (query: string) {
     return originalModuleRequire.call(this, query)
 }
 
-export type ProgressCallback = (current: number, total: number) => void // eslint-disable-line @typescript-eslint/no-type-alias
+export type ProgressCallback = (current: number, total: number) => void
 
 export function initModuleLookup (userPluginsPath: string): void {
     global['module'].paths.map((x: string) => nodeModule.globalPaths.push(normalizePath(x)))

+ 1 - 1
tabby-core/src/components/splitTab.component.ts

@@ -592,7 +592,7 @@ export class SplitTabComponent extends BaseTabComponent implements AfterViewInit
 
         if (zone.type === 'relative') {
             this.add(tab, zone.relativeTo ?? null, zone.side)
-        } else if (zone.container) {
+        } else {
             this.add(tab, zone.container.children[zone.position], zone.container.orientation === 'h' ? 'r' : 'b')
         }
         this.tabAdopted.next(tab)

+ 1 - 1
tabby-core/src/components/splitTabDropZone.component.ts

@@ -34,7 +34,7 @@ export class SplitTabDropZoneComponent extends SelfPositioningComponent {
     ) {
         super(element)
         this.subscribeUntilDestroyed(app.tabDragActive$, tab => {
-            this.isActive = !!tab && tab !== this.parent && (this.dropZone.type === 'relative' || tab !== this.dropZone.container?.children[this.dropZone.position])
+            this.isActive = !!tab && tab !== this.parent && (this.dropZone.type === 'relative' || tab !== this.dropZone.container.children[this.dropZone.position])
             this.layout()
         })
     }

+ 0 - 1
tabby-core/src/services/tabs.service.ts

@@ -2,7 +2,6 @@ import { Injectable, ComponentFactoryResolver, Injector } from '@angular/core'
 import { BaseTabComponent } from '../components/baseTab.component'
 import { TabRecoveryService } from './tabRecovery.service'
 
-// eslint-disable-next-line @typescript-eslint/no-type-alias
 export interface TabComponentType<T extends BaseTabComponent> {
     // eslint-disable-next-line @typescript-eslint/prefer-function-type
     new (...args: any[]): T

+ 3 - 3
tabby-terminal/src/api/streamProcessing.ts

@@ -6,9 +6,9 @@ import { Subject, Observable, interval, debounce } from 'rxjs'
 import { PassThrough, Readable, Writable } from 'stream'
 import { ReadLine, createInterface as createReadline, clearLine } from 'readline'
 
-export type InputMode = null | 'local-echo' | 'readline' | 'readline-hex' // eslint-disable-line @typescript-eslint/no-type-alias
-export type OutputMode = null | 'hex' // eslint-disable-line @typescript-eslint/no-type-alias
-export type NewlineMode = null | 'cr' | 'lf' | 'crlf' // eslint-disable-line @typescript-eslint/no-type-alias
+export type InputMode = null | 'local-echo' | 'readline' | 'readline-hex'
+export type OutputMode = null | 'hex'
+export type NewlineMode = null | 'cr' | 'lf' | 'crlf'
 
 export interface StreamProcessingOptions {
     inputMode?: InputMode