From 0f43507bcbed2533a1b5ebe9e38f3a4b503b7328 Mon Sep 17 00:00:00 2001 From: Mikhail Zolotukhin Date: Fri, 17 Sep 2021 23:13:38 +0300 Subject: [PATCH] refactor: :rotating_light: fix a bundh of linter errors --- src/controller/index.ts | 2 +- src/driver/surface.ts | 4 ++-- src/engine/index.ts | 4 ++-- src/engine/layout/cascade_layout.ts | 6 +++++- src/engine/layout/layout_part.ts | 4 ++-- src/engine/layout/monocle_layout.ts | 6 +++++- src/engine/layout/three_column_layout.ts | 6 +++++- 7 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/controller/index.ts b/src/controller/index.ts index a731c070..0bc3f414 100644 --- a/src/controller/index.ts +++ b/src/controller/index.ts @@ -348,7 +348,7 @@ export class TilingController implements Controller { window.timestamp = new Date().getTime(); } - public onShortcut(input: Shortcut, data?: any): void { + public onShortcut(input: Shortcut, data?: string): void { if (this.config.directionalKeyMode === "focus") { switch (input) { case Shortcut.Up: diff --git a/src/driver/surface.ts b/src/driver/surface.ts index 79d51efd..949f1eae 100644 --- a/src/driver/surface.ts +++ b/src/driver/surface.ts @@ -24,10 +24,10 @@ export class KWinSurface implements DriverSurface { ): string { let path = String(screen); if (config.layoutPerActivity) { - path += "@" + activity; + path += `@${activity}`; } if (config.layoutPerDesktop) { - path += "#" + desktop; + path += `"#${desktop}`; } return path; } diff --git a/src/engine/index.ts b/src/engine/index.ts index 6a83aaa2..2edb5360 100644 --- a/src/engine/index.ts +++ b/src/engine/index.ts @@ -308,7 +308,7 @@ export class TilingEngine implements Engine { * which is straight against the purpose of tiling WM. This operation * move/resize such windows back to where/how they should be. */ - public enforceSize(window: Window) { + public enforceSize(window: Window): void { if (window.tiled && !window.actualGeometry.equals(window.geometry)) { qmlSetTimeout(() => { if (window.tiled) { @@ -566,7 +566,7 @@ export class TilingEngine implements Engine { * * @returns True if the layout overrides the shortcut. False, otherwise. */ - public handleLayoutShortcut(input: Shortcut, data?: any): boolean { + public handleLayoutShortcut(input: Shortcut, data?: string): boolean { const layout = this.layouts.getCurrentLayout( this.controller.currentSurface ); diff --git a/src/engine/layout/cascade_layout.ts b/src/engine/layout/cascade_layout.ts index 7ff276f7..7760d9f1 100644 --- a/src/engine/layout/cascade_layout.ts +++ b/src/engine/layout/cascade_layout.ts @@ -95,7 +95,11 @@ export default class CascadeLayout implements WindowsLayout { return new CascadeLayout(this.dir); } - public handleShortcut(engine: Engine, input: Shortcut, _data?: any): boolean { + public handleShortcut( + engine: Engine, + input: Shortcut, + _data?: string + ): boolean { switch (input) { case Shortcut.Increase: this.dir = (this.dir + 1 + 8) % 8; diff --git a/src/engine/layout/layout_part.ts b/src/engine/layout/layout_part.ts index cbe6146c..d36e8078 100644 --- a/src/engine/layout/layout_part.ts +++ b/src/engine/layout/layout_part.ts @@ -33,7 +33,7 @@ export class FillLayoutPart implements ILayoutPart { } public apply(area: Rect, tiles: Window[]): Rect[] { - return tiles.map((tile) => { + return tiles.map((_tile) => { return area; }); } @@ -245,7 +245,7 @@ export class RotateLayoutPart implements ILayoutPart { switch (this.angle) { case 0: - delta = delta; + // No adjustment needed break; case 90: delta = new RectDelta(delta.south, delta.north, delta.east, delta.west); diff --git a/src/engine/layout/monocle_layout.ts b/src/engine/layout/monocle_layout.ts index 37091a3c..b596994e 100644 --- a/src/engine/layout/monocle_layout.ts +++ b/src/engine/layout/monocle_layout.ts @@ -60,7 +60,11 @@ export default class MonocleLayout implements WindowsLayout { return this; } - public handleShortcut(engine: Engine, input: Shortcut, _data?: any): boolean { + public handleShortcut( + engine: Engine, + input: Shortcut, + _data?: string + ): boolean { switch (input) { case Shortcut.Up: case Shortcut.FocusUp: diff --git a/src/engine/layout/three_column_layout.ts b/src/engine/layout/three_column_layout.ts index 9a2e79cf..cd524297 100644 --- a/src/engine/layout/three_column_layout.ts +++ b/src/engine/layout/three_column_layout.ts @@ -197,7 +197,11 @@ export default class ThreeColumnLayout implements WindowsLayout { return other; } - public handleShortcut(engine: Engine, input: Shortcut, _data?: any): boolean { + public handleShortcut( + engine: Engine, + input: Shortcut, + _data?: string + ): boolean { switch (input) { case Shortcut.Increase: this.resizeMaster(engine, +1);