Procházet zdrojové kódy

reenabled @typescript-eslint/no-shadow

Eugene Pankov před 5 roky
rodič
revize
e6bf76c616

+ 0 - 1
.eslintrc.yml

@@ -113,4 +113,3 @@ rules:
   '@typescript-eslint/no-implicit-any-catch': off
   '@typescript-eslint/member-ordering': off
   '@typescript-eslint/no-var-requires': off
-  '@typescript-eslint/no-shadow': off

+ 2 - 2
app/src/entry.ts

@@ -58,8 +58,8 @@ findPlugins().then(async plugins => {
         window['safeModeReason'] = error
         try {
             await bootstrap(plugins, true)
-        } catch (error) {
-            console.error('Bootstrap failed:', error)
+        } catch (error2) {
+            console.error('Bootstrap failed:', error2)
         }
     }
 })

+ 5 - 5
app/src/plugins.ts

@@ -3,13 +3,13 @@ import * as path from 'path'
 const nodeModule = require('module') // eslint-disable-line @typescript-eslint/no-var-requires
 const nodeRequire = (global as any).require
 
-function normalizePath (path: string): string {
+function normalizePath (p: string): string {
     const cygwinPrefix = '/cygdrive/'
-    if (path.startsWith(cygwinPrefix)) {
-        path = path.substring(cygwinPrefix.length).replace('/', '\\')
-        path = path[0] + ':' + path.substring(1)
+    if (p.startsWith(cygwinPrefix)) {
+        p = p.substring(cygwinPrefix.length).replace('/', '\\')
+        p = p[0] + ':' + p.substring(1)
     }
-    return path
+    return p
 }
 
 global['module'].paths.map((x: string) => nodeModule.globalPaths.push(normalizePath(x)))

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

@@ -520,7 +520,7 @@ export class SplitTabComponent extends BaseTabComponent implements AfterViewInit
 
     private layoutInternal (root: SplitContainer, x: number, y: number, w: number, h: number) {
         const size = root.orientation === 'v' ? h : w
-        const sizes = root.ratios.map(x => x * size)
+        const sizes = root.ratios.map(ratio => ratio * size)
 
         root.x = x
         root.y = y

+ 2 - 2
terminus-core/src/components/splitTabSpanner.component.ts

@@ -34,8 +34,8 @@ export class SplitTabSpannerComponent {
             let current = start
             const oldPosition: number = this.isVertical ? this.element.nativeElement.offsetTop : this.element.nativeElement.offsetLeft
 
-            const dragHandler = (e: MouseEvent) => {
-                current = this.isVertical ? e.pageY : e.pageX
+            const dragHandler = (dragEvent: MouseEvent) => {
+                current = this.isVertical ? dragEvent.pageY : dragEvent.pageX
                 const newPosition = oldPosition + (current - start)
                 if (this.isVertical) {
                     this.element.nativeElement.style.top = `${newPosition - this.marginOffset}px`

+ 3 - 3
terminus-ssh/src/api.ts

@@ -76,10 +76,10 @@ export class ForwardedPort {
             })
         } else if (this.type === PortForwardType.Dynamic) {
             return new Promise((resolve, reject) => {
-                this.listener = socksv5.createServer((info, accept, reject) => {
+                this.listener = socksv5.createServer((info, acceptConnection, rejectConnection) => {
                     callback(
-                        () => accept(true),
-                        () => reject(),
+                        () => acceptConnection(true),
+                        () => rejectConnection(),
                         null,
                         null,
                         info.dstAddr,

+ 2 - 2
terminus-ssh/src/components/editConnectionModal.component.ts

@@ -99,8 +99,8 @@ export class EditConnectionModalComponent {
     save () {
         for (const k of Object.values(SSHAlgorithmType)) {
             this.connection.algorithms![k] = Object.entries(this.algorithms[k])
-                .filter(([_k, v]) => !!v)
-                .map(([k, _v]) => k)
+                .filter(([_, v]) => !!v)
+                .map(([key, _]) => key)
         }
         this.modalInstance.close(this.connection)
     }

+ 1 - 0
terminus-ssh/src/services/ssh.service.ts

@@ -210,6 +210,7 @@ export class SSHService {
                 if (await fs.exists(WINDOWS_OPENSSH_AGENT_PIPE)) {
                     agent = WINDOWS_OPENSSH_AGENT_PIPE
                 } else {
+                    // eslint-disable-next-line @typescript-eslint/no-shadow
                     const pageantRunning = await new Promise<boolean>(resolve => {
                         windowsProcessTreeNative.getProcessList(list => { // eslint-disable-line block-scoped-var
                             resolve(list.some(x => x.name === 'pageant.exe'))