From 336c6c012ed56136e61e21629abdb7e8e2bf278d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kiss=20R=C3=B3bert?= Date: Wed, 6 May 2026 19:11:06 +0200 Subject: [PATCH] style: allow @typescript-eslint/no-explicit-any linter rule --- eslint.config.mjs | 1 - packages/kboot/src/models/data-option.ts | 2 +- packages/kboot/src/util/index.ts | 2 +- .../kboot/src/util/is-null-or-undefined.ts | 2 +- .../src/util/usb/encode-command-option.ts | 2 +- packages/kboot/test/uhk-helpers/index.ts | 2 +- packages/mcumgr/src/mcumgr.ts | 9 +++-- packages/mcumgr/src/serial-peripheral.ts | 2 +- packages/mcumgr/src/util/cbor.ts | 6 +-- packages/mcumgr/src/util/convert-to-hex.ts | 2 +- packages/mcumgr/src/util/crc16.ts | 2 +- packages/mcumgr/src/util/from-uint16.ts | 2 +- packages/uhk-agent/src/electron-main.ts | 2 +- packages/uhk-agent/src/electron-menu.ts | 4 +- packages/uhk-agent/src/models/queue-entry.ts | 1 + .../src/services/app-update.service.ts | 2 +- .../uhk-agent/src/services/device.service.ts | 40 +++++++++---------- .../uhk-agent/src/services/logger.service.ts | 4 ++ .../src/services/main-service-base.ts | 1 + .../src/services/smart-macro-doc.service.ts | 6 +-- .../uhk-agent/src/services/sudo.service.ts | 2 +- .../src/services/zephyr-log.service.ts | 4 +- packages/uhk-agent/src/util/create-png.ts | 1 + .../uhk-agent/src/util/get-updater-logger.ts | 1 + .../src/util/restore-user-configuration.ts | 1 + .../src/util/save-extract-firmware.ts | 1 + packages/uhk-agent/src/util/window.ts | 3 ++ .../src/config-serializer/assert.ts | 2 + .../config-items/hardware-configuration.ts | 2 + .../config-items/host-connection.ts | 6 ++- .../key-action/connections-action.ts | 1 + .../config-items/key-action/helper.ts | 3 ++ .../config-items/key-action/key-action.ts | 3 ++ .../key-action/key-label-action.ts | 2 + .../key-action/keystroke-action.test.ts | 8 ++-- .../config-items/key-action/mouse-action.ts | 4 ++ .../config-items/key-action/none-action.ts | 2 + .../key-action/none-block-action.ts | 2 + .../config-items/key-action/other-action.ts | 1 + .../key-action/play-macro-action.ts | 6 +++ .../key-action/switch-keymap-action.ts | 5 +++ .../key-action/switch-layer-action.ts | 4 ++ .../config-serializer/config-items/keymap.ts | 5 ++- .../config-serializer/config-items/layer.ts | 8 +++- .../macro-action/command-macro-action.ts | 3 ++ .../macro-action/delay-macro-action.ts | 3 ++ .../config-items/macro-action/helper.ts | 2 + .../macro-action/key-macro-action.ts | 1 + .../config-items/macro-action/macro-action.ts | 2 + .../macro-action/mouse-button-macro-action.ts | 1 + .../macro-action/move-mouse-macro-action.ts | 3 ++ .../macro-action/scroll-mouse-macro-action.ts | 3 ++ .../macro-action/text-macro-action.ts | 3 ++ .../config-serializer/config-items/macro.ts | 5 ++- .../config-items/module-configuration.ts | 4 ++ .../config-serializer/config-items/module.ts | 5 ++- .../config-items/rgb-color.ts | 2 + .../config-items/scancode-checker.ts | 2 + .../config-items/user-configuration.test.ts | 1 + .../config-items/user-configuration.ts | 1 + .../src/config-serializer/uhk-buffer.ts | 3 +- packages/uhk-common/src/log/logger.service.ts | 1 + .../uhk-common/src/models/notification.ts | 2 +- packages/uhk-common/src/util/helpers.ts | 2 + packages/uhk-common/src/util/index.ts | 1 + .../uhk-common/src/util/is-equal-array.ts | 2 +- .../uhk-common/test/serializer-test-helper.ts | 2 + packages/uhk-usb/src/uhk-hid-device.ts | 4 +- packages/uhk-usb/src/uhk-operations.ts | 1 + packages/uhk-usb/src/util.ts | 4 +- .../src/utils/get-firmware-package-json.ts | 1 + .../utils/get-package-json-from-path-async.ts | 2 + .../src/utils/usb-device-json-formatter.ts | 1 + packages/uhk-web/src/app/app.component.ts | 2 +- packages/uhk-web/src/app/app.routes.ts | 2 +- .../app/components/add-on/add-on.component.ts | 1 + .../auto-grow-input.component.ts | 8 ++-- .../circle-tooltip.component.ts | 2 +- .../fade-timeout-slider.component.ts | 8 ++-- .../editable-text/editable-text.component.ts | 8 ++-- .../command/macro-command-editor.component.ts | 9 +++-- .../tab/key/macro-key.component.ts | 2 + .../macro/item/macro-item.component.ts | 1 + .../components/popover/popover.component.ts | 4 +- .../tab/keypress/keypress-tab.component.ts | 1 + .../second-side-menu-container.component.ts | 1 + .../slider-wrapper.component.ts | 7 +++- .../svg-icon-text-key.component.ts | 8 ++-- .../svg-keyboard-key.component.ts | 1 + .../svg-keyboard-key.model.ts | 1 + .../svg-keystroke-key.component.ts | 1 + .../svg/keys/svg-mouse-key/svg-mouse-key.ts | 1 + .../svg-secondary-role.component.ts | 4 +- .../svg/module/svg-module.component.ts | 4 ++ .../components/svg/module/svg-module.model.ts | 10 +++-- .../separator/convert-xml-to-svg-separator.ts | 1 + .../app/components/uhk-header/uhk-header.ts | 2 +- .../src/app/models/firmware-upgrade-error.ts | 1 + .../src/app/models/select-option-data.ts | 1 + .../set-module-configuration-value-payload.ts | 1 + .../services/app-update-renderer.service.ts | 6 +++ .../app/services/device-renderer.service.ts | 2 +- .../src/app/services/ipc-common-renderer.ts | 1 + .../key-action-drag-and-drop.service.ts | 3 ++ .../app/services/smart-macro-doc-service.ts | 2 + .../app/store/actions/app-update.action.ts | 2 +- packages/uhk-web/src/app/store/actions/app.ts | 2 +- .../app/store/actions/auto-update-settings.ts | 2 +- packages/uhk-web/src/app/store/effects/app.ts | 2 + .../default-user-configuration.effect.ts | 1 + .../uhk-web/src/app/store/effects/device.ts | 4 +- .../uhk-web/src/app/store/effects/macro.ts | 1 + .../src/app/store/effects/user-config.ts | 1 + .../src/app/store/reducers/app.reducer.ts | 2 +- .../store/reducers/contributors.reducer.ts | 2 +- .../app/store/reducers/user-configuration.ts | 4 ++ .../src/app/util/default-uhk-theme-colors.ts | 1 + packages/uhk-web/src/app/util/html-helper.ts | 2 +- .../src/app/util/status-buffer-parser.ts | 2 +- packages/uhk-web/src/polyfills.ts | 2 + .../src/renderer/models/sender-message.ts | 6 --- ...electron-datastorage-repository.service.ts | 1 + .../electron-error-handler.service.ts | 2 +- .../renderer/services/electron-log.service.ts | 2 + .../src/renderer/services/ipc-uhk-renderer.ts | 1 + 125 files changed, 272 insertions(+), 114 deletions(-) delete mode 100644 packages/uhk-web/src/renderer/models/sender-message.ts diff --git a/eslint.config.mjs b/eslint.config.mjs index f93b0fe015e..6902b1c75ad 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -11,7 +11,6 @@ const globalIgnores = [ export const typescriptRules = { '@typescript-eslint/no-base-to-string': 'off', - '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-misused-promises': 'off', '@typescript-eslint/no-redundant-type-constituents': 'off', '@typescript-eslint/no-unnecessary-type-assertion': 'off', diff --git a/packages/kboot/src/models/data-option.ts b/packages/kboot/src/models/data-option.ts index e6409b308d3..246a108c3b2 100644 --- a/packages/kboot/src/models/data-option.ts +++ b/packages/kboot/src/models/data-option.ts @@ -1,5 +1,5 @@ export interface DataOption { startAddress: number; - data: Buffer; + data: Buffer | Uint8Array; timeout?: number; } diff --git a/packages/kboot/src/util/index.ts b/packages/kboot/src/util/index.ts index dddf9f325d7..a7414b90a3c 100644 --- a/packages/kboot/src/util/index.ts +++ b/packages/kboot/src/util/index.ts @@ -3,7 +3,7 @@ export * from './response-parser.js'; export * from './usb/index.js'; export * from './snooze.js'; -export const convertToHexString = (arr: number[] | Buffer): string => { +export const convertToHexString = (arr: number[] | Buffer | Uint8Array): string => { let str = ''; for (const n of arr) { diff --git a/packages/kboot/src/util/is-null-or-undefined.ts b/packages/kboot/src/util/is-null-or-undefined.ts index 462f9d58f91..30faa3a85e5 100644 --- a/packages/kboot/src/util/is-null-or-undefined.ts +++ b/packages/kboot/src/util/is-null-or-undefined.ts @@ -1,3 +1,3 @@ -export function isNullOrUndefined(value: any) : boolean { +export function isNullOrUndefined(value: unknown) : boolean { return value === undefined || value === null; } diff --git a/packages/kboot/src/util/usb/encode-command-option.ts b/packages/kboot/src/util/usb/encode-command-option.ts index 3926ca109c1..621269fa375 100644 --- a/packages/kboot/src/util/usb/encode-command-option.ts +++ b/packages/kboot/src/util/usb/encode-command-option.ts @@ -31,7 +31,7 @@ export const encodeCommandOption = (option: CommandOption): number[] => { return [...header, ...payload, ...placeholders]; }; -export const validateCommandParams = (params: any[]): void => { +export const validateCommandParams = (params: number[]): void => { if (isNullOrUndefined(params)) { return; } diff --git a/packages/kboot/test/uhk-helpers/index.ts b/packages/kboot/test/uhk-helpers/index.ts index 4a427191406..2f221cb3142 100644 --- a/packages/kboot/test/uhk-helpers/index.ts +++ b/packages/kboot/test/uhk-helpers/index.ts @@ -24,7 +24,7 @@ export const reenumerate = (mode: UhkReenumerationModes): void => { ); }; -export const readBootloaderFirmwareFromHexFile = (): Map => { +export const readBootloaderFirmwareFromHexFile = (): MemoryMap => { const hexFilePath = join(import.meta.dirname, '../../../../tmp/packages/firmware/devices/uhk60-right/firmware.hex'); const fileContent = readFileSync(hexFilePath, { encoding: 'utf8' }); const memoryMap = MemoryMap.fromHex(fileContent); diff --git a/packages/mcumgr/src/mcumgr.ts b/packages/mcumgr/src/mcumgr.ts index b3af39275e2..867cc0ee091 100644 --- a/packages/mcumgr/src/mcumgr.ts +++ b/packages/mcumgr/src/mcumgr.ts @@ -64,9 +64,9 @@ export class McuManager { /** * Query images from the device * TODO: Implement response structure - * @returns {Promise<*>} + * @returns {Promise>} */ - async imageReadState():Promise { + async imageReadState():Promise> { logger('Start send image read state command'); return this.sendCommand(MGMT_OP.READ, MGMT_GROUP.IMAGE, IMAGE_OPERATION.STATE); } @@ -118,7 +118,7 @@ export class McuManager { /** * Send command to the microcontroller */ - async sendCommand(op: MGMT_OP_TYPE, group: MGMT_GROUP_TYPE, id: MGMT_OPERATION_TYPE, data?: any): Promise> { + async sendCommand(op: MGMT_OP_TYPE, group: MGMT_GROUP_TYPE, id: MGMT_OPERATION_TYPE, data?: unknown): Promise> { logger('Start send command: %o', {op, group, id, data}); let encodedData = []; @@ -156,7 +156,7 @@ export class McuManager { #parseNmpMessage(buffer: Buffer): NmpResponse { const [op, flags, length_hi, length_lo, group_hi, group_lo, seq, id] = buffer; - let data: any; + let data: unknown; // the buffer contains data // TODO: Maybe worth validate the length of the data section = header.length @@ -173,6 +173,7 @@ export class McuManager { seq, id, data, + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any; } diff --git a/packages/mcumgr/src/serial-peripheral.ts b/packages/mcumgr/src/serial-peripheral.ts index 663b4e303c4..9d30d35df7f 100644 --- a/packages/mcumgr/src/serial-peripheral.ts +++ b/packages/mcumgr/src/serial-peripheral.ts @@ -194,7 +194,7 @@ export class SerialPeripheral implements Peripheral { }); } - async #_write(data: any): Promise { + async #_write(data: unknown): Promise { await this.open(); logger('Write packet %o', data); diff --git a/packages/mcumgr/src/util/cbor.ts b/packages/mcumgr/src/util/cbor.ts index a0b0072be64..cb96b18cecc 100644 --- a/packages/mcumgr/src/util/cbor.ts +++ b/packages/mcumgr/src/util/cbor.ts @@ -13,7 +13,7 @@ const POW_2_24 = 5.960464477539063e-8, POW_2_32 = 4294967296, POW_2_53 = 9007199254740992; -export function encode(value: any) { +export function encode(value: unknown) { let data = new ArrayBuffer(256); let dataView = new DataView(data); let lastLength: number; @@ -36,7 +36,7 @@ export function encode(value: any) { lastLength = length; return dataView; } - function commitWrite(x?: any) { + function commitWrite(_?: unknown) { offset += lastLength; } function writeFloat64(value) { @@ -169,7 +169,7 @@ export function encode(value: any) { return ret; } -export function decode(data: any, tagger?: Function, simpleValue?: Function) { +export function decode(data: ArrayBuffer | SharedArrayBuffer, tagger?: Function, simpleValue?: Function) { const dataView = new DataView(data); let offset = 0; diff --git a/packages/mcumgr/src/util/convert-to-hex.ts b/packages/mcumgr/src/util/convert-to-hex.ts index 7aa76e307f3..986896f6b98 100644 --- a/packages/mcumgr/src/util/convert-to-hex.ts +++ b/packages/mcumgr/src/util/convert-to-hex.ts @@ -1,6 +1,6 @@ /** * Convert the byte array to hexadecimal string */ -export default function convertToHex(arr: Array): String { +export default function convertToHex(arr: Array): String { return arr.map(x => x.toString(16).padStart(2, '0')).join(' '); } diff --git a/packages/mcumgr/src/util/crc16.ts b/packages/mcumgr/src/util/crc16.ts index 285e9ea4516..4f5312dc5cc 100644 --- a/packages/mcumgr/src/util/crc16.ts +++ b/packages/mcumgr/src/util/crc16.ts @@ -33,7 +33,7 @@ const CRC16TABLE = new Uint16Array([ 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 ]); -export default function crc16(data: ArrayLike): number { +export default function crc16(data: ArrayLike): number { let crc = 0; const l = data.length; for (let i = 0; i < l; i++) { diff --git a/packages/mcumgr/src/util/from-uint16.ts b/packages/mcumgr/src/util/from-uint16.ts index ae66fda9f22..4cee68d6fad 100644 --- a/packages/mcumgr/src/util/from-uint16.ts +++ b/packages/mcumgr/src/util/from-uint16.ts @@ -1,6 +1,6 @@ /** * Create a number from the first 2 bytes of the Array. It uses big edian encoding */ -export default function fromUint16(arr: ArrayLike | Buffer): number { +export default function fromUint16(arr: ArrayLike | Buffer): number { return (arr[0] * 256) + arr[1]; } diff --git a/packages/uhk-agent/src/electron-main.ts b/packages/uhk-agent/src/electron-main.ts index 6ea335164f9..30c1062dc46 100644 --- a/packages/uhk-agent/src/electron-main.ts +++ b/packages/uhk-agent/src/electron-main.ts @@ -129,7 +129,7 @@ async function createWindow() { slashes: true })); - win.on('page-title-updated', (event: any) => { + win.on('page-title-updated', (event) => { event.preventDefault(); }); diff --git a/packages/uhk-agent/src/electron-menu.ts b/packages/uhk-agent/src/electron-menu.ts index d300e7af4bc..09d61741c76 100644 --- a/packages/uhk-agent/src/electron-menu.ts +++ b/packages/uhk-agent/src/electron-menu.ts @@ -29,9 +29,9 @@ export const setMenu = (win: BrowserWindow, allowDevTools): void => { if (process.platform === 'darwin') { // hide "Start Dictation" submenu item in Edit menu - systemPreferences.setUserDefault('NSDisabledDictationMenuItem', 'boolean', true as any); + systemPreferences.setUserDefault('NSDisabledDictationMenuItem', 'boolean', true); // hide "Emoji & Symbols" submenu item in Edit menu - systemPreferences.setUserDefault('NSDisabledCharacterPaletteMenuItem', 'boolean', false as any); + systemPreferences.setUserDefault('NSDisabledCharacterPaletteMenuItem', 'boolean', false); } const menu = Menu.buildFromTemplate(template); diff --git a/packages/uhk-agent/src/models/queue-entry.ts b/packages/uhk-agent/src/models/queue-entry.ts index 6f9df70b73b..eb557324e3f 100644 --- a/packages/uhk-agent/src/models/queue-entry.ts +++ b/packages/uhk-agent/src/models/queue-entry.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ export interface QueueEntry { method: Function; bind: any; diff --git a/packages/uhk-agent/src/services/app-update.service.ts b/packages/uhk-agent/src/services/app-update.service.ts index 17633eaeae0..5b925b43838 100644 --- a/packages/uhk-agent/src/services/app-update.service.ts +++ b/packages/uhk-agent/src/services/app-update.service.ts @@ -96,7 +96,7 @@ export class AppUpdateService extends MainServiceBase { } }); - ipcMain.on(IpcEvents.autoUpdater.checkForUpdate, (event: Electron.Event, args: any[]) => { + ipcMain.on(IpcEvents.autoUpdater.checkForUpdate, (event: Electron.Event, args) => { const allowPrerelease: boolean = args[0]; const logMsg = `[AppUpdateService] checkForUpdate request from renderer process. Allow prerelease: ${allowPrerelease}`; this.logService.misc(logMsg); diff --git a/packages/uhk-agent/src/services/device.service.ts b/packages/uhk-agent/src/services/device.service.ts index bd3b1de4c04..2bfcbda3cdf 100644 --- a/packages/uhk-agent/src/services/device.service.ts +++ b/packages/uhk-agent/src/services/device.service.ts @@ -159,7 +159,7 @@ export class DeviceService { this.logService.misc('[DeviceService] Cannot query udev info:', error); }); - ipcMain.on(IpcEvents.device.areBleAddressesPaired, (...args: any[]) => { + ipcMain.on(IpcEvents.device.areBleAddressesPaired, (...args) => { this.queueManager.add({ method: this.areBleAddressesPaired, bind: this, @@ -168,7 +168,7 @@ export class DeviceService { }); }); - ipcMain.on(IpcEvents.device.changeKeyboardLayout, (...args: any[]) => { + ipcMain.on(IpcEvents.device.changeKeyboardLayout, (...args) => { this.queueManager.add({ method: this.changeKeyboardLayout, bind: this, @@ -177,7 +177,7 @@ export class DeviceService { }); }); - ipcMain.on(IpcEvents.device.deleteHostConnection, (...args: any[]) => { + ipcMain.on(IpcEvents.device.deleteHostConnection, (...args) => { this.queueManager.add({ method: this.deleteHostConnection, bind: this, @@ -186,7 +186,7 @@ export class DeviceService { }); }); - ipcMain.on(IpcEvents.device.eraseBleSettings, (...args: any[]) => { + ipcMain.on(IpcEvents.device.eraseBleSettings, (...args) => { this.queueManager.add({ method: this.eraseBleSettings, bind: this, @@ -197,7 +197,7 @@ export class DeviceService { ipcMain.on(IpcEvents.device.toggleI2cDebugging, this.toggleI2cDebugging.bind(this)); - ipcMain.on(IpcEvents.device.isRightHalfZephyrLoggingEnabled, (...args: any[]) => { + ipcMain.on(IpcEvents.device.isRightHalfZephyrLoggingEnabled, (...args) => { this.queueManager.add({ method: this.isRightHalfZephyrLoggingEnabled, bind: this, @@ -206,7 +206,7 @@ export class DeviceService { }); }); - ipcMain.on(IpcEvents.device.toggleRightHalfZephyrLogging, (...args: any[]) => { + ipcMain.on(IpcEvents.device.toggleRightHalfZephyrLogging, (...args) => { this.queueManager.add({ method: this.toggleRightHalfZephyrLogging, bind: this, @@ -215,7 +215,7 @@ export class DeviceService { }); }); - ipcMain.on(IpcEvents.device.saveUserConfiguration, (...args: any[]) => { + ipcMain.on(IpcEvents.device.saveUserConfiguration, (...args) => { this.queueManager.add({ method: this.saveUserConfiguration, bind: this, @@ -224,7 +224,7 @@ export class DeviceService { }); }); - ipcMain.on(IpcEvents.device.loadConfigurations, (...args: any[]) => { + ipcMain.on(IpcEvents.device.loadConfigurations, (...args) => { this.queueManager.add({ method: this.loadConfigurations, bind: this, @@ -233,7 +233,7 @@ export class DeviceService { }); }); - ipcMain.on(IpcEvents.device.updateFirmware, (...args: any[]) => { + ipcMain.on(IpcEvents.device.updateFirmware, (...args) => { this.queueManager.add({ method: this.updateFirmware, bind: this, @@ -244,7 +244,7 @@ export class DeviceService { ipcMain.on(IpcEvents.device.startConnectionPoller, this.startPollUhkDevice.bind(this)); - ipcMain.on(IpcEvents.device.startDonglePairing, (...args: any[]) => { + ipcMain.on(IpcEvents.device.startDonglePairing, (...args) => { this.queueManager.add({ method: this.startDonglePairing, bind: this, @@ -253,7 +253,7 @@ export class DeviceService { }); }); - ipcMain.on(IpcEvents.device.startLeftHalfPairing, (...args: any[]) => { + ipcMain.on(IpcEvents.device.startLeftHalfPairing, (...args) => { this.queueManager.add({ method: this.startLeftHalfPairing, bind: this, @@ -263,7 +263,7 @@ export class DeviceService { }); - ipcMain.on(IpcEvents.device.recoveryDevice, (...args: any[]) => { + ipcMain.on(IpcEvents.device.recoveryDevice, (...args) => { this.queueManager.add({ method: this.recoveryDevice, bind: this, @@ -272,7 +272,7 @@ export class DeviceService { }); }); - ipcMain.on(IpcEvents.device.recoveryModule, (...args: any[]) => { + ipcMain.on(IpcEvents.device.recoveryModule, (...args) => { this.queueManager.add({ method: this.recoveryModule, bind: this, @@ -281,7 +281,7 @@ export class DeviceService { }); }); - ipcMain.on(IpcEvents.device.enableUsbStackTest, (...args: any[]) => { + ipcMain.on(IpcEvents.device.enableUsbStackTest, (...args) => { this.queueManager.add({ method: this.enableUsbStackTest, bind: this, @@ -290,7 +290,7 @@ export class DeviceService { }); }); - ipcMain.on(IpcEvents.device.readConfigSizes, (...args: any[]) => { + ipcMain.on(IpcEvents.device.readConfigSizes, (...args) => { this.queueManager.add({ method: this.readConfigSizes, bind: this, @@ -306,7 +306,7 @@ export class DeviceService { logService.misc('[DeviceService] init success'); } - public async areBleAddressesPaired(event: Electron.IpcMainEvent, args: Array): Promise { + public async areBleAddressesPaired(event: Electron.IpcMainEvent, args): Promise { this.logService.misc('[DeviceService] Check BLE Addresses are paired'); const response: AreBleAddressesPairedIpcResponse = { @@ -341,7 +341,7 @@ export class DeviceService { * Return with the actual UserConfiguration from UHK Device * @returns {Promise} */ - public async loadConfigurations(event: Electron.IpcMainEvent, args: Array): Promise { + public async loadConfigurations(event: Electron.IpcMainEvent, args): Promise { this.logService.misc('[DeviceService] load user configuration'); let response: ConfigurationReply; @@ -789,7 +789,7 @@ export class DeviceService { event.sender.send(IpcEvents.device.updateFirmwareReply, response); } - public async recoveryDevice(event: Electron.IpcMainEvent, args: Array): Promise { + public async recoveryDevice(event: Electron.IpcMainEvent, args): Promise { const response: FirmwareUpgradeIpcResponse = { success: false, }; @@ -845,7 +845,7 @@ export class DeviceService { this.startPollUhkDevice(); } - public async recoveryModule(event: Electron.IpcMainEvent, args: Array): Promise { + public async recoveryModule(event: Electron.IpcMainEvent, args): Promise { const response: FirmwareUpgradeIpcResponse = { success: false, }; @@ -907,7 +907,7 @@ export class DeviceService { } } - public async deleteHostConnection(event: Electron.IpcMainEvent, args: Array): Promise { + public async deleteHostConnection(event: Electron.IpcMainEvent, args): Promise { const {isConnectedDongleAddress, index, address} = args[0]; this.logService.misc('[DeviceService] delete host connection', { isConnectedDongleAddress, index, address }); diff --git a/packages/uhk-agent/src/services/logger.service.ts b/packages/uhk-agent/src/services/logger.service.ts index 8a17e03c791..6208034f16f 100644 --- a/packages/uhk-agent/src/services/logger.service.ts +++ b/packages/uhk-agent/src/services/logger.service.ts @@ -29,10 +29,12 @@ export class ElectronLogService extends LogService { logUserConfigHelper(this.log, message, config); } + // eslint-disable-next-line @typescript-eslint/no-explicit-any error(...args: any[]): void { log.error(...args); } + // eslint-disable-next-line @typescript-eslint/no-explicit-any misc(...args: any[]): void { if (!this._options.misc) { return; @@ -41,6 +43,7 @@ export class ElectronLogService extends LogService { this.log(...args); } + // eslint-disable-next-line @typescript-eslint/no-explicit-any usb(...args: any[]): void { if (!this._options.usb) { return; @@ -75,6 +78,7 @@ export class ElectronLogService extends LogService { this.log('%c' + args.join(' '), 'color:orange'); } + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected log(...args: any[]): void { log.log(...args); } diff --git a/packages/uhk-agent/src/services/main-service-base.ts b/packages/uhk-agent/src/services/main-service-base.ts index 44e5f5131a2..b5a3ec8bfc4 100644 --- a/packages/uhk-agent/src/services/main-service-base.ts +++ b/packages/uhk-agent/src/services/main-service-base.ts @@ -4,6 +4,7 @@ export class MainServiceBase { constructor(protected logService: LogService, protected win: Electron.BrowserWindow) {} + // eslint-disable-next-line @typescript-eslint/no-explicit-any protected sendIpcToWindow(message: string, arg?: any) { this.logService.misc('sendIpcToWindow:', message, arg); if (!this.win || this.win.isDestroyed()) { diff --git a/packages/uhk-agent/src/services/smart-macro-doc.service.ts b/packages/uhk-agent/src/services/smart-macro-doc.service.ts index c523a673deb..5038f7bd49f 100644 --- a/packages/uhk-agent/src/services/smart-macro-doc.service.ts +++ b/packages/uhk-agent/src/services/smart-macro-doc.service.ts @@ -29,7 +29,7 @@ export class SmartMacroDocService { constructor(private logService: LogService, private rootDir: string) { this.rootPath = getSmartMacroDocRootPath(); - ipcMain.on(IpcEvents.app.getAppStartInfo, (...args: any[]) => { + ipcMain.on(IpcEvents.app.getAppStartInfo, (...args) => { this.queueManager.add({ method: this.handleAppStartInfo, bind: this, @@ -37,7 +37,7 @@ export class SmartMacroDocService { asynchronous: true }); }); - ipcMain.on(IpcEvents.smartMacroDoc.downloadDocumentation, (...args: any[]) => { + ipcMain.on(IpcEvents.smartMacroDoc.downloadDocumentation, (...args) => { this.queueManager.add({ method: this.handleDownloadDocumentation, bind: this, @@ -156,7 +156,7 @@ export class SmartMacroDocService { event.sender.send(IpcEvents.smartMacroDoc.serviceListening, this.port); } - private async handleDownloadDocumentation(event: Electron.IpcMainEvent, args: Array): Promise { + private async handleDownloadDocumentation(event: Electron.IpcMainEvent, args): Promise { try { const firmwareRepoInfo: FirmwareRepoInfo = args[0]; if (!firmwareRepoInfo.firmwareGitRepo || !firmwareRepoInfo.firmwareGitTag) { diff --git a/packages/uhk-agent/src/services/sudo.service.ts b/packages/uhk-agent/src/services/sudo.service.ts index 194b28a9ce1..c0433ea60c5 100644 --- a/packages/uhk-agent/src/services/sudo.service.ts +++ b/packages/uhk-agent/src/services/sudo.service.ts @@ -60,7 +60,7 @@ export class SudoService { }; const command = `sh ${scriptPath}`; this.logService.misc('[SudoService] Set privilege command: ', command); - sudo.exec(command, options, async (error: any) => { + sudo.exec(command, options, async (error: Error) => { const response = new IpcResponse(); if (error) { diff --git a/packages/uhk-agent/src/services/zephyr-log.service.ts b/packages/uhk-agent/src/services/zephyr-log.service.ts index ab624d85083..1172f5ac0d1 100644 --- a/packages/uhk-agent/src/services/zephyr-log.service.ts +++ b/packages/uhk-agent/src/services/zephyr-log.service.ts @@ -31,7 +31,7 @@ export class ZephyrLogService { private operationLimiter = pLimit(1); constructor(private options: ZephyrLogServiceOptions) { - ipcMain.on(options.ipcEvents.isZephyrLoggingEnabled, (...args: any[]) => { + ipcMain.on(options.ipcEvents.isZephyrLoggingEnabled, (...args) => { this.queueManager.add({ method: this.isZephyrLoggingEnabled, bind: this, @@ -40,7 +40,7 @@ export class ZephyrLogService { }); }); - ipcMain.on(options.ipcEvents.toggleZephyrLogging, (...args: any[]) => { + ipcMain.on(options.ipcEvents.toggleZephyrLogging, (...args) => { this.queueManager.add({ method: this.toggleZephyrLogging, bind: this, diff --git a/packages/uhk-agent/src/util/create-png.ts b/packages/uhk-agent/src/util/create-png.ts index e443f7ca2c3..5387990b21f 100644 --- a/packages/uhk-agent/src/util/create-png.ts +++ b/packages/uhk-agent/src/util/create-png.ts @@ -54,6 +54,7 @@ export function createPNG(width: number, height: number, pixelData: Buffer>> 0; // Convert to unsigned 32-bit } diff --git a/packages/uhk-agent/src/util/get-updater-logger.ts b/packages/uhk-agent/src/util/get-updater-logger.ts index 74845cb4746..2e5ab66d0a4 100644 --- a/packages/uhk-agent/src/util/get-updater-logger.ts +++ b/packages/uhk-agent/src/util/get-updater-logger.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { LogService } from 'uhk-common'; export function getUpdaterLoggerService(logService: LogService) { diff --git a/packages/uhk-agent/src/util/restore-user-configuration.ts b/packages/uhk-agent/src/util/restore-user-configuration.ts index dd9be4a24fc..98e7f03da09 100644 --- a/packages/uhk-agent/src/util/restore-user-configuration.ts +++ b/packages/uhk-agent/src/util/restore-user-configuration.ts @@ -21,6 +21,7 @@ export interface RestoreUserConfigurationOptions { export async function restoreUserConfiguration(options: RestoreUserConfigurationOptions): Promise { try { const device = await getCurrentUhkDeviceProduct(options.commandLineArgs); + // eslint-disable-next-line @typescript-eslint/no-explicit-any let userConfigJson: any; if (!device) { diff --git a/packages/uhk-agent/src/util/save-extract-firmware.ts b/packages/uhk-agent/src/util/save-extract-firmware.ts index 8b8e1fc5287..b5fe30b8c4f 100644 --- a/packages/uhk-agent/src/util/save-extract-firmware.ts +++ b/packages/uhk-agent/src/util/save-extract-firmware.ts @@ -43,6 +43,7 @@ export async function saveTmpFirmware(fileData: UploadFileData): Promise ({ export const loadWindowState = (logger: LogService): Partial => { logger.misc('[WindowState] load settings'); try { + // eslint-disable-next-line @typescript-eslint/no-explicit-any const loadedState = settings.getSync(WINDOWS_SETTINGS_KEY) as any; logger.misc('[WindowState] loaded settings', loadedState); @@ -58,6 +59,7 @@ export const loadWindowState = (logger: LogService): Partial => { export const saveWindowState = (win: electron.BrowserWindow, logger: LogService) => { const winBounds = win.isMaximized() || win.isFullScreen() + // eslint-disable-next-line @typescript-eslint/no-explicit-any ? loadWindowState(logger) as any : win.getBounds(); @@ -68,6 +70,7 @@ export const saveWindowState = (win: electron.BrowserWindow, logger: LogService) }; logger.misc('[WindowState] save settings:', state); + // eslint-disable-next-line @typescript-eslint/no-explicit-any settings.setSync(WINDOWS_SETTINGS_KEY, state as any); logger.misc('[WindowState] save settings success'); }; diff --git a/packages/uhk-common/src/config-serializer/assert.ts b/packages/uhk-common/src/config-serializer/assert.ts index f33c13f0bf8..75482050758 100644 --- a/packages/uhk-common/src/config-serializer/assert.ts +++ b/packages/uhk-common/src/config-serializer/assert.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ + export function assertUInt8(target: any, key: string) { return assertInteger(target, key, 0, 0xFF); } diff --git a/packages/uhk-common/src/config-serializer/config-items/hardware-configuration.ts b/packages/uhk-common/src/config-serializer/config-items/hardware-configuration.ts index 19fd0473789..3745231e45c 100644 --- a/packages/uhk-common/src/config-serializer/config-items/hardware-configuration.ts +++ b/packages/uhk-common/src/config-serializer/config-items/hardware-configuration.ts @@ -21,6 +21,7 @@ export class HardwareConfiguration { isIso: boolean; + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObject(jsonObject: any): HardwareConfiguration { this.signature = jsonObject.signature; this.majorVersion = jsonObject.majorVersion; @@ -51,6 +52,7 @@ export class HardwareConfiguration { } } + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJsonObject(): any { return { signature: this.signature, diff --git a/packages/uhk-common/src/config-serializer/config-items/host-connection.ts b/packages/uhk-common/src/config-serializer/config-items/host-connection.ts index cc1fb304df5..aef9695073d 100644 --- a/packages/uhk-common/src/config-serializer/config-items/host-connection.ts +++ b/packages/uhk-common/src/config-serializer/config-items/host-connection.ts @@ -66,6 +66,7 @@ export class HostConnection { } } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObject(jsonObject: any, serialisationInfo: SerialisationInfo): HostConnection { switch (serialisationInfo.userConfigMajorVersion) { case 8: @@ -99,8 +100,9 @@ export class HostConnection { throw new Error(`HostConnection configuration does not support version: ${serialisationInfo.userConfigMajorVersion}`); } } - + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJsonObject(): any { + // eslint-disable-next-line @typescript-eslint/no-explicit-any const json: any = { type: HostConnections[this.type], }; @@ -187,6 +189,7 @@ export class HostConnection { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private fromJsonObjectV8(jsonObject: any, serialisationInfo: SerialisationInfo): HostConnection { this.type = HostConnections[jsonObject.type]; if (this.hasAddress()) { @@ -213,6 +216,7 @@ export class HostConnection { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private fromJsonObjectV9(jsonObject: any, serialisationInfo: SerialisationInfo): HostConnection { this.type = HostConnections[jsonObject.type]; if (this.hasAddress()) { diff --git a/packages/uhk-common/src/config-serializer/config-items/key-action/connections-action.ts b/packages/uhk-common/src/config-serializer/config-items/key-action/connections-action.ts index 52cee8b5f5f..ee2688430e9 100644 --- a/packages/uhk-common/src/config-serializer/config-items/key-action/connections-action.ts +++ b/packages/uhk-common/src/config-serializer/config-items/key-action/connections-action.ts @@ -28,6 +28,7 @@ export class ConnectionsAction extends KeyAction { this.hostConnectionId = other.hostConnectionId; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObject(jsonObject: any, serialisationInfo: SerialisationInfo): ConnectionsAction { this.assertKeyActionType(jsonObject); this.command = ConnectionCommands[jsonObject.command] diff --git a/packages/uhk-common/src/config-serializer/config-items/key-action/helper.ts b/packages/uhk-common/src/config-serializer/config-items/key-action/helper.ts index a01331a6b9e..a02f88e78b0 100644 --- a/packages/uhk-common/src/config-serializer/config-items/key-action/helper.ts +++ b/packages/uhk-common/src/config-serializer/config-items/key-action/helper.ts @@ -17,6 +17,7 @@ import { isAllowedScancode } from '../scancode-checker.js'; export class Helper { + // eslint-disable-next-line @typescript-eslint/no-explicit-any static createKeyAction(source: KeyAction | UhkBuffer | any, macros: Macro[], serialisationInfo: SerialisationInfo): KeyAction { if (source instanceof KeyAction) { return Helper.fromKeyAction(source); @@ -117,6 +118,7 @@ export class Helper { return newKeyAction; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any static fromJSONObject(keyAction: any, macros: Macro[], serialisationInfo: SerialisationInfo): KeyAction { switch (serialisationInfo.userConfigMajorVersion) { case 1: @@ -139,6 +141,7 @@ export class Helper { } } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private static fromJSONObjectV1(keyAction: any, macros: Macro[], serialisationInfo: SerialisationInfo): KeyAction { if (!keyAction) { return new NoneAction(); diff --git a/packages/uhk-common/src/config-serializer/config-items/key-action/key-action.ts b/packages/uhk-common/src/config-serializer/config-items/key-action/key-action.ts index 1fa812c8d5a..4cf24cc3d41 100644 --- a/packages/uhk-common/src/config-serializer/config-items/key-action/key-action.ts +++ b/packages/uhk-common/src/config-serializer/config-items/key-action/key-action.ts @@ -56,6 +56,7 @@ export abstract class KeyAction implements RgbColorInterface { this.r = keyAction?.r ?? DEFAULT_RGB_COLOR.r; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any assertKeyActionType(jsObject: any): void { const keyActionClassname: string = this.getName(); const keyActionTypeString: string = keyActionType[keyActionClassname]; @@ -78,6 +79,7 @@ export abstract class KeyAction implements RgbColorInterface { return readKeyActionId; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any abstract toJsonObject(serialisationInfo: SerialisationInfo, macros?: Macro[]): any; abstract toBinary(buffer: UhkBuffer, serialisationInfo: SerialisationInfo, userConfiguration?: UserConfiguration): void; @@ -96,6 +98,7 @@ export abstract class KeyAction implements RgbColorInterface { } } + // eslint-disable-next-line @typescript-eslint/no-explicit-any rgbColorFromJson(jsonObject: any, serialisationInfo: SerialisationInfo): void { if (serialisationInfo.isUserConfigContainsRgbColors) { this.b = jsonObject.b; diff --git a/packages/uhk-common/src/config-serializer/config-items/key-action/key-label-action.ts b/packages/uhk-common/src/config-serializer/config-items/key-action/key-label-action.ts index e3eed202bf7..e4db7334c44 100644 --- a/packages/uhk-common/src/config-serializer/config-items/key-action/key-label-action.ts +++ b/packages/uhk-common/src/config-serializer/config-items/key-action/key-label-action.ts @@ -15,6 +15,7 @@ export class KeyLabelAction extends KeyAction { } } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObject(jsonObject: any): KeyLabelAction { this.assertKeyActionType(jsonObject); this.label = jsonObject.label; @@ -29,6 +30,7 @@ export class KeyLabelAction extends KeyAction { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJsonObject(): any { return { keyActionType: keyActionType.KeyLabelAction, diff --git a/packages/uhk-common/src/config-serializer/config-items/key-action/keystroke-action.test.ts b/packages/uhk-common/src/config-serializer/config-items/key-action/keystroke-action.test.ts index 1a1bafcc4f3..0ebaf9af7a4 100644 --- a/packages/uhk-common/src/config-serializer/config-items/key-action/keystroke-action.test.ts +++ b/packages/uhk-common/src/config-serializer/config-items/key-action/keystroke-action.test.ts @@ -55,7 +55,7 @@ describe('keystroke-action', () => { it('should not change the "type" to "shortMedia" when is "longMedia" if scancode < 256', ({ assert }) => { const action = new KeystrokeAction(); - action.type = KeystrokeType.longMedia as any; + action.type = KeystrokeType.longMedia; action.scancode = 125; assert.strictEqual(action.type, KeystrokeType.shortMedia); }); @@ -70,7 +70,7 @@ describe('keystroke-action', () => { it('should not change the "type" to "longMedia" when is "shortMedia" if scancode >= 256', ({ assert }) => { const action = new KeystrokeAction(); - action.type = KeystrokeType.shortMedia as any; + action.type = KeystrokeType.shortMedia; action.scancode = 256; assert.strictEqual(action.type, KeystrokeType.longMedia); }); @@ -148,7 +148,7 @@ describe('keystroke-action', () => { }); it('should change the value to "longMedia" if scancode >= 256 and value "shortMedia"', ({ assert }) => { - const value = KeystrokeType.shortMedia as any; + const value = KeystrokeType.shortMedia; const scancode = 256; const action = new KeystrokeAction(); action.scancode = scancode; @@ -168,7 +168,7 @@ describe('keystroke-action', () => { }); it('should change the value to "shortMedia" if scancode < 256 and value "longMedia"', ({ assert }) => { - const value = KeystrokeType.longMedia as any; + const value = KeystrokeType.longMedia; const scancode = 100; const action = new KeystrokeAction(); action.scancode = scancode; diff --git a/packages/uhk-common/src/config-serializer/config-items/key-action/mouse-action.ts b/packages/uhk-common/src/config-serializer/config-items/key-action/mouse-action.ts index 8fa6b93a70c..3e7e21d68c8 100644 --- a/packages/uhk-common/src/config-serializer/config-items/key-action/mouse-action.ts +++ b/packages/uhk-common/src/config-serializer/config-items/key-action/mouse-action.ts @@ -48,6 +48,7 @@ export class MouseAction extends KeyAction { this.mouseAction = other.mouseAction; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObject(jsonObject: any, serialisationInfo: SerialisationInfo): MouseAction { switch (serialisationInfo.userConfigMajorVersion) { case 1: @@ -104,6 +105,7 @@ export class MouseAction extends KeyAction { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJsonObject(serialisationInfo: SerialisationInfo): any { return { keyActionType: keyActionType.MouseAction, @@ -126,12 +128,14 @@ export class MouseAction extends KeyAction { return 'MouseAction'; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private fromJsonObjectV1(jsObject: any): MouseAction { this.assertKeyActionType(jsObject); this.mouseAction = MouseActionParam[jsObject.mouseAction]; return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private fromJsonObjectV6(jsObject: any, serialisationInfo: SerialisationInfo): void { this.fromJsonObjectV1(jsObject); this.rgbColorFromJson(jsObject, serialisationInfo); diff --git a/packages/uhk-common/src/config-serializer/config-items/key-action/none-action.ts b/packages/uhk-common/src/config-serializer/config-items/key-action/none-action.ts index 54ca06da391..e7daf725b14 100644 --- a/packages/uhk-common/src/config-serializer/config-items/key-action/none-action.ts +++ b/packages/uhk-common/src/config-serializer/config-items/key-action/none-action.ts @@ -15,6 +15,7 @@ export class NoneAction extends KeyAction { super(other); } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObject(jsonObject: any, serialisationInfo: SerialisationInfo): NoneAction { this.assertKeyActionType(jsonObject); this.rgbColorFromJson(jsonObject, serialisationInfo); @@ -29,6 +30,7 @@ export class NoneAction extends KeyAction { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJsonObject(serialisationInfo: SerialisationInfo): any { return { keyActionType: keyActionType.NoneAction, diff --git a/packages/uhk-common/src/config-serializer/config-items/key-action/none-block-action.ts b/packages/uhk-common/src/config-serializer/config-items/key-action/none-block-action.ts index 84b5eeb8974..ca44683d07c 100644 --- a/packages/uhk-common/src/config-serializer/config-items/key-action/none-block-action.ts +++ b/packages/uhk-common/src/config-serializer/config-items/key-action/none-block-action.ts @@ -22,6 +22,7 @@ export class NoneBlockAction extends KeyAction { this.blockCount = other.blockCount } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObject(jsonObject: any, serialisationInfo: SerialisationInfo): NoneBlockAction { this.assertKeyActionType(jsonObject); this.blockCount = jsonObject.blockCount; @@ -38,6 +39,7 @@ export class NoneBlockAction extends KeyAction { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJsonObject(serialisationInfo: SerialisationInfo): any { return { keyActionType: keyActionType.NoneBlockAction, diff --git a/packages/uhk-common/src/config-serializer/config-items/key-action/other-action.ts b/packages/uhk-common/src/config-serializer/config-items/key-action/other-action.ts index 5788d0c2f79..d7517182d3b 100644 --- a/packages/uhk-common/src/config-serializer/config-items/key-action/other-action.ts +++ b/packages/uhk-common/src/config-serializer/config-items/key-action/other-action.ts @@ -21,6 +21,7 @@ export class OtherAction extends KeyAction { this.actionSubtype = other.actionSubtype } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObject(jsonObject: any, serialisationInfo: SerialisationInfo): OtherAction { this.assertKeyActionType(jsonObject); this.actionSubtype = OtherActionSubTypes[jsonObject.actionSubtype]; diff --git a/packages/uhk-common/src/config-serializer/config-items/key-action/play-macro-action.ts b/packages/uhk-common/src/config-serializer/config-items/key-action/play-macro-action.ts index c31350db345..68653614b06 100644 --- a/packages/uhk-common/src/config-serializer/config-items/key-action/play-macro-action.ts +++ b/packages/uhk-common/src/config-serializer/config-items/key-action/play-macro-action.ts @@ -18,6 +18,7 @@ export class MacroArgumentAction extends KeyAction { } } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObject(jsonObject: any): MacroArgumentAction { this.assertKeyActionType(jsonObject); this.value = jsonObject.value; @@ -32,6 +33,7 @@ export class MacroArgumentAction extends KeyAction { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJsonObject(): any { return { keyActionType: keyActionType.MacroArgumentAction, @@ -79,6 +81,7 @@ export class PlayMacroAction extends KeyAction { } } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObject(jsonObject: any, serialisationInfo: SerialisationInfo, macros: Macro[]): PlayMacroAction { switch (serialisationInfo.userConfigMajorVersion) { case 1: @@ -135,6 +138,7 @@ export class PlayMacroAction extends KeyAction { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJsonObject(serialisationInfo: SerialisationInfo, macros: Macro[]): any { return { keyActionType: keyActionType.PlayMacroAction, @@ -162,12 +166,14 @@ export class PlayMacroAction extends KeyAction { return 'PlayMacroAction'; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private fromJsonObjectV1(jsonObject: any, macros: Macro[]): PlayMacroAction { this.assertKeyActionType(jsonObject); this.macroId = macros[jsonObject.macroIndex].id; return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private fromJsonObjectV6(jsonObject: any, macros: Macro[], serialisationInfo: SerialisationInfo): void { this.fromJsonObjectV1(jsonObject, macros); this.rgbColorFromJson(jsonObject, serialisationInfo); diff --git a/packages/uhk-common/src/config-serializer/config-items/key-action/switch-keymap-action.ts b/packages/uhk-common/src/config-serializer/config-items/key-action/switch-keymap-action.ts index 4dd0c8f1cc3..863ef5397bd 100644 --- a/packages/uhk-common/src/config-serializer/config-items/key-action/switch-keymap-action.ts +++ b/packages/uhk-common/src/config-serializer/config-items/key-action/switch-keymap-action.ts @@ -27,6 +27,7 @@ export class SwitchKeymapAction extends KeyAction { } } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObject(jsonObject: any, serialisationInfo: SerialisationInfo): SwitchKeymapAction { switch (serialisationInfo.userConfigMajorVersion) { case 1: @@ -55,6 +56,7 @@ export class SwitchKeymapAction extends KeyAction { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJsonObject(serialisationInfo: SerialisationInfo): any { return { keyActionType: keyActionType.SwitchKeymapAction, @@ -85,11 +87,13 @@ export class SwitchKeymapAction extends KeyAction { return 'SwitchKeymapAction'; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private fromJsonObjectV1(jsonObject: any): void { this.assertKeyActionType(jsonObject); this.keymapAbbreviation = jsonObject.keymapAbbreviation; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private fromJsonObjectV6(jsonObject: any, serialisationInfo: SerialisationInfo): void { this.fromJsonObjectV1(jsonObject); this.rgbColorFromJson(jsonObject, serialisationInfo); @@ -139,6 +143,7 @@ export class UnresolvedSwitchKeymapAction extends KeyAction { this.rgbColorToBinary(buffer, serialisationInfo); } + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJsonObject(): any { throw new Error('UnresolvedSwitchKeymapAction cannot be serialized directly. Convert it to SwitchKeymapAction first.'); } diff --git a/packages/uhk-common/src/config-serializer/config-items/key-action/switch-layer-action.ts b/packages/uhk-common/src/config-serializer/config-items/key-action/switch-layer-action.ts index a8812a99eca..d4bc1134fac 100644 --- a/packages/uhk-common/src/config-serializer/config-items/key-action/switch-layer-action.ts +++ b/packages/uhk-common/src/config-serializer/config-items/key-action/switch-layer-action.ts @@ -57,6 +57,7 @@ export class SwitchLayerAction extends KeyAction { this.layer = other.layer; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObject(jsonObject: any, serialisationInfo: SerialisationInfo): SwitchLayerAction { switch (serialisationInfo.userConfigMajorVersion) { case 1: @@ -113,6 +114,7 @@ export class SwitchLayerAction extends KeyAction { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJsonObject(serialisationInfo: SerialisationInfo): any { return { keyActionType: keyActionType.SwitchLayerAction, @@ -137,6 +139,7 @@ export class SwitchLayerAction extends KeyAction { return 'SwitchLayerAction'; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private fromJsonObjectV1(jsonObject: any): void { this.assertKeyActionType(jsonObject); this.layer = LayerName[jsonObject.layer]; @@ -150,6 +153,7 @@ export class SwitchLayerAction extends KeyAction { } } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private fromJsonObjectV6(jsonObject: any, serialisationInfo: SerialisationInfo): void { this.fromJsonObjectV1(jsonObject); this.rgbColorFromJson(jsonObject, serialisationInfo); diff --git a/packages/uhk-common/src/config-serializer/config-items/keymap.ts b/packages/uhk-common/src/config-serializer/config-items/keymap.ts index ae850133702..8327e08a192 100644 --- a/packages/uhk-common/src/config-serializer/config-items/keymap.ts +++ b/packages/uhk-common/src/config-serializer/config-items/keymap.ts @@ -29,6 +29,7 @@ export class Keymap { this.layers = keymap.layers.map(layer => new Layer(layer)); } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObject(jsonObject: any, macros: Macro[], serialisationInfo: SerialisationInfo): Keymap { switch (serialisationInfo.userConfigMajorVersion) { case 1: @@ -83,6 +84,7 @@ export class Keymap { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJsonObject(serialisationInfo: SerialisationInfo, macros?: Macro[]): any { return { isDefault: this.isDefault, @@ -179,12 +181,13 @@ export class Keymap { } } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private fromJsonObjectV1(jsonObject: any, macros: Macro[], serialisationInfo: SerialisationInfo): void { this.isDefault = jsonObject.isDefault; this.abbreviation = jsonObject.abbreviation; this.name = jsonObject.name; this.description = jsonObject.description; - this.layers = jsonObject.layers.map((layer: any) => new Layer().fromJsonObject(layer, macros, serialisationInfo)); + this.layers = jsonObject.layers.map((layer) => new Layer().fromJsonObject(layer, macros, serialisationInfo)); } private fromBinaryV1(buffer: UhkBuffer, macros: Macro[], serialisationInfo: SerialisationInfo): void { diff --git a/packages/uhk-common/src/config-serializer/config-items/layer.ts b/packages/uhk-common/src/config-serializer/config-items/layer.ts index e6a0cc78e3f..6da0fe9ef1a 100644 --- a/packages/uhk-common/src/config-serializer/config-items/layer.ts +++ b/packages/uhk-common/src/config-serializer/config-items/layer.ts @@ -25,6 +25,7 @@ export class Layer { this.uhkThemeColors = layers.uhkThemeColors; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObject(jsonObject: any, macros: Macro[], serialisationInfo: SerialisationInfo): Layer { switch (serialisationInfo.userConfigMajorVersion) { case 1: @@ -81,6 +82,7 @@ export class Layer { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJsonObject(serialisationInfo: SerialisationInfo, macros?: Macro[]): any { return { id: LayerName[this.id], @@ -120,8 +122,9 @@ export class Layer { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObjectV1(jsonObject: any, macros: Macro[], serialisationInfo: SerialisationInfo): void { - this.modules = jsonObject.modules.map((module: any) => { + this.modules = jsonObject.modules.map((module) => { return new Module().fromJsonObject(module, macros, serialisationInfo); }); } @@ -132,9 +135,10 @@ export class Layer { }); } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObjectV5(jsonObject: any, macros: Macro[], serialisationInfo: SerialisationInfo): void { this.id = LayerName[jsonObject.id]; - this.modules = jsonObject.modules.map((module: any) => { + this.modules = jsonObject.modules.map((module) => { return new Module().fromJsonObject(module, macros, serialisationInfo); }); } diff --git a/packages/uhk-common/src/config-serializer/config-items/macro-action/command-macro-action.ts b/packages/uhk-common/src/config-serializer/config-items/macro-action/command-macro-action.ts index 8b78f5d6148..911563cf00b 100644 --- a/packages/uhk-common/src/config-serializer/config-items/macro-action/command-macro-action.ts +++ b/packages/uhk-common/src/config-serializer/config-items/macro-action/command-macro-action.ts @@ -14,6 +14,7 @@ export class CommandMacroAction extends MacroAction { this.command = other.command; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObject(jsonObject: any, serialisationInfo: SerialisationInfo): CommandMacroAction { switch (serialisationInfo.userConfigMajorVersion) { case 1: @@ -64,6 +65,7 @@ export class CommandMacroAction extends MacroAction { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJsonObject(): any { return { macroActionType: macroActionType.CommandMacroAction, @@ -84,6 +86,7 @@ export class CommandMacroAction extends MacroAction { return 'CommandMacroAction'; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private fromJsonObjectV1(jsObject: any): void { this.assertMacroActionType(jsObject); this.command = jsObject.command; diff --git a/packages/uhk-common/src/config-serializer/config-items/macro-action/delay-macro-action.ts b/packages/uhk-common/src/config-serializer/config-items/macro-action/delay-macro-action.ts index 3841411a580..21f882402b4 100644 --- a/packages/uhk-common/src/config-serializer/config-items/macro-action/delay-macro-action.ts +++ b/packages/uhk-common/src/config-serializer/config-items/macro-action/delay-macro-action.ts @@ -15,6 +15,7 @@ export class DelayMacroAction extends MacroAction { this.delay = other.delay; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObject(jsonObject: any, serialisationInfo: SerialisationInfo): DelayMacroAction { switch (serialisationInfo.userConfigMajorVersion) { case 1: @@ -65,6 +66,7 @@ export class DelayMacroAction extends MacroAction { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJsonObject(): any { return { macroActionType: macroActionType.DelayMacroAction, @@ -85,6 +87,7 @@ export class DelayMacroAction extends MacroAction { return 'DelayMacroAction'; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private fromJsonObjectV1(jsObject: any): void { this.assertMacroActionType(jsObject); this.delay = jsObject.delay; diff --git a/packages/uhk-common/src/config-serializer/config-items/macro-action/helper.ts b/packages/uhk-common/src/config-serializer/config-items/macro-action/helper.ts index 4f1c41d1b7e..2d55e1685b4 100644 --- a/packages/uhk-common/src/config-serializer/config-items/macro-action/helper.ts +++ b/packages/uhk-common/src/config-serializer/config-items/macro-action/helper.ts @@ -11,6 +11,7 @@ import { CommandMacroAction } from './command-macro-action.js'; export class Helper { + // eslint-disable-next-line @typescript-eslint/no-explicit-any static createMacroAction(source: MacroAction | UhkBuffer | any, serialisationInfo: SerialisationInfo): MacroAction { if (source instanceof MacroAction) { return Helper.fromMacroAction(source); @@ -69,6 +70,7 @@ export class Helper { return newMacroAction; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any static fromJSONObject(macroAction: any, serialisationInfo: SerialisationInfo): MacroAction { switch (macroAction.macroActionType) { case macroActionType.KeyMacroAction: diff --git a/packages/uhk-common/src/config-serializer/config-items/macro-action/key-macro-action.ts b/packages/uhk-common/src/config-serializer/config-items/macro-action/key-macro-action.ts index 0f4ca6aa101..12db006db08 100644 --- a/packages/uhk-common/src/config-serializer/config-items/macro-action/key-macro-action.ts +++ b/packages/uhk-common/src/config-serializer/config-items/macro-action/key-macro-action.ts @@ -97,6 +97,7 @@ export class KeyMacroAction extends MacroAction { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJsonObject(): any { const jsObject: JsObjectKeyMacroAction = { macroActionType: macroActionType.KeyMacroAction, diff --git a/packages/uhk-common/src/config-serializer/config-items/macro-action/macro-action.ts b/packages/uhk-common/src/config-serializer/config-items/macro-action/macro-action.ts index 23d2b817bbd..d65f7cdc7bc 100644 --- a/packages/uhk-common/src/config-serializer/config-items/macro-action/macro-action.ts +++ b/packages/uhk-common/src/config-serializer/config-items/macro-action/macro-action.ts @@ -47,6 +47,7 @@ export const macroActionType = { }; export abstract class MacroAction { + // eslint-disable-next-line @typescript-eslint/no-explicit-any assertMacroActionType(jsObject: any) { const macroActionClassname = this.getName(); const macroActionTypeString = macroActionType[macroActionClassname]; @@ -74,6 +75,7 @@ export abstract class MacroAction { return readMacroActionId; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any abstract toJsonObject(): any; abstract toBinary(buffer: UhkBuffer): void; diff --git a/packages/uhk-common/src/config-serializer/config-items/macro-action/mouse-button-macro-action.ts b/packages/uhk-common/src/config-serializer/config-items/macro-action/mouse-button-macro-action.ts index 28b99ca213f..510b795e5cc 100644 --- a/packages/uhk-common/src/config-serializer/config-items/macro-action/mouse-button-macro-action.ts +++ b/packages/uhk-common/src/config-serializer/config-items/macro-action/mouse-button-macro-action.ts @@ -79,6 +79,7 @@ export class MouseButtonMacroAction extends MacroAction { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJsonObject(): any { return { macroActionType: macroActionType.MouseButtonMacroAction, diff --git a/packages/uhk-common/src/config-serializer/config-items/macro-action/move-mouse-macro-action.ts b/packages/uhk-common/src/config-serializer/config-items/macro-action/move-mouse-macro-action.ts index f3ccd2e7a4d..2995f7b1596 100644 --- a/packages/uhk-common/src/config-serializer/config-items/macro-action/move-mouse-macro-action.ts +++ b/packages/uhk-common/src/config-serializer/config-items/macro-action/move-mouse-macro-action.ts @@ -18,6 +18,7 @@ export class MoveMouseMacroAction extends MacroAction { this.y = other.y; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObject(jsonObject: any, serialisationInfo: SerialisationInfo): MoveMouseMacroAction { switch (serialisationInfo.userConfigMajorVersion) { case 1: @@ -68,6 +69,7 @@ export class MoveMouseMacroAction extends MacroAction { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJsonObject(): any { return { macroActionType: macroActionType.MoveMouseMacroAction, @@ -90,6 +92,7 @@ export class MoveMouseMacroAction extends MacroAction { return 'MoveMouseMacroAction'; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private fromJsonObjectV1(jsObject: any): void { this.assertMacroActionType(jsObject); this.x = jsObject.x; diff --git a/packages/uhk-common/src/config-serializer/config-items/macro-action/scroll-mouse-macro-action.ts b/packages/uhk-common/src/config-serializer/config-items/macro-action/scroll-mouse-macro-action.ts index c19643cd4a9..085496a519b 100644 --- a/packages/uhk-common/src/config-serializer/config-items/macro-action/scroll-mouse-macro-action.ts +++ b/packages/uhk-common/src/config-serializer/config-items/macro-action/scroll-mouse-macro-action.ts @@ -18,6 +18,7 @@ export class ScrollMouseMacroAction extends MacroAction { this.y = other.y; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObject(jsonObject: any, serialisationInfo: SerialisationInfo): ScrollMouseMacroAction { switch (serialisationInfo.userConfigMajorVersion) { case 1: @@ -68,6 +69,7 @@ export class ScrollMouseMacroAction extends MacroAction { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJsonObject(): any { return { macroActionType: macroActionType.ScrollMouseMacroAction, @@ -90,6 +92,7 @@ export class ScrollMouseMacroAction extends MacroAction { return 'ScrollMouseMacroAction'; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private fromJsonObjectV1(jsObject: any): void { this.assertMacroActionType(jsObject); this.x = jsObject.x; diff --git a/packages/uhk-common/src/config-serializer/config-items/macro-action/text-macro-action.ts b/packages/uhk-common/src/config-serializer/config-items/macro-action/text-macro-action.ts index 42e5cfd16a9..2ce86583331 100644 --- a/packages/uhk-common/src/config-serializer/config-items/macro-action/text-macro-action.ts +++ b/packages/uhk-common/src/config-serializer/config-items/macro-action/text-macro-action.ts @@ -14,6 +14,7 @@ export class TextMacroAction extends MacroAction { this.text = other.text; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObject(jsonObject: any, serialisationInfo: SerialisationInfo): TextMacroAction { switch (serialisationInfo.userConfigMajorVersion) { case 1: @@ -64,6 +65,7 @@ export class TextMacroAction extends MacroAction { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJsonObject(): any { return { macroActionType: macroActionType.TextMacroAction, @@ -84,6 +86,7 @@ export class TextMacroAction extends MacroAction { return 'TextMacroAction'; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private fromJsonObjectV1(jsObject: any): void { this.assertMacroActionType(jsObject); this.text = jsObject.text; diff --git a/packages/uhk-common/src/config-serializer/config-items/macro.ts b/packages/uhk-common/src/config-serializer/config-items/macro.ts index cc9099e3dd2..59c1041a5c1 100644 --- a/packages/uhk-common/src/config-serializer/config-items/macro.ts +++ b/packages/uhk-common/src/config-serializer/config-items/macro.ts @@ -27,6 +27,7 @@ export class Macro { this.macroActions = other.macroActions.map(macroAction => MacroActionHelper.fromMacroAction(macroAction)); } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObject(jsonObject: any, serialisationInfo: SerialisationInfo): Macro { switch (serialisationInfo.userConfigMajorVersion) { case 1: @@ -77,6 +78,7 @@ export class Macro { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJsonObject(): any { return { isLooped: this.isLooped, @@ -97,11 +99,12 @@ export class Macro { return ``; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private fromJsonObjectV1(jsonObject: any, serialisationInfo: SerialisationInfo): void { this.isLooped = jsonObject.isLooped; this.isPrivate = jsonObject.isPrivate; this.name = jsonObject.name; - this.macroActions = jsonObject.macroActions.map((macroAction: any) => { + this.macroActions = jsonObject.macroActions.map((macroAction) => { return MacroActionHelper.createMacroAction(macroAction, serialisationInfo); }); } diff --git a/packages/uhk-common/src/config-serializer/config-items/module-configuration.ts b/packages/uhk-common/src/config-serializer/config-items/module-configuration.ts index e3f1113cb88..98d00ad3e95 100644 --- a/packages/uhk-common/src/config-serializer/config-items/module-configuration.ts +++ b/packages/uhk-common/src/config-serializer/config-items/module-configuration.ts @@ -80,6 +80,7 @@ export class ModuleConfiguration { this.touchpadPinchToZoom = other.touchpadPinchToZoom; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObject(jsonObject: any, serialisationInfo: SerialisationInfo): ModuleConfiguration { switch (serialisationInfo.userConfigMajorVersion) { case 1: @@ -134,7 +135,9 @@ export class ModuleConfiguration { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJsonObject(): any { + // eslint-disable-next-line @typescript-eslint/no-explicit-any const json: any = { id: ModuleId[this.id], @@ -235,6 +238,7 @@ export class ModuleConfiguration { return ``; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private fromJsonObjectV7(jsonObject: any): void { this.id = ModuleId[jsonObject.id as string]; diff --git a/packages/uhk-common/src/config-serializer/config-items/module.ts b/packages/uhk-common/src/config-serializer/config-items/module.ts index d31efc3597b..a6cb3dcaa0f 100644 --- a/packages/uhk-common/src/config-serializer/config-items/module.ts +++ b/packages/uhk-common/src/config-serializer/config-items/module.ts @@ -31,6 +31,7 @@ export class Module { this.keyActions = other.keyActions.map(keyAction => KeyActionHelper.fromKeyAction(keyAction)); } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObject(jsonObject: any, macros: Macro[], serialisationInfo: SerialisationInfo): Module { switch (serialisationInfo.userConfigMajorVersion) { case 1: @@ -81,6 +82,7 @@ export class Module { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any toJsonObject(serialisationInfo: SerialisationInfo, macros?: Macro[]): any { return { id: this.id, @@ -130,9 +132,10 @@ export class Module { return this; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObjectV1(jsonObject: any, macros: Macro[], serialisationInfo: SerialisationInfo): void { this.id = jsonObject.id; - this.keyActions = jsonObject.keyActions.map((keyAction: any) => { + this.keyActions = jsonObject.keyActions.map((keyAction) => { return KeyActionHelper.fromJSONObject(keyAction, macros, serialisationInfo); }); } diff --git a/packages/uhk-common/src/config-serializer/config-items/rgb-color.ts b/packages/uhk-common/src/config-serializer/config-items/rgb-color.ts index d42dab40b19..6d39bee9310 100644 --- a/packages/uhk-common/src/config-serializer/config-items/rgb-color.ts +++ b/packages/uhk-common/src/config-serializer/config-items/rgb-color.ts @@ -22,6 +22,7 @@ export class RgbColor { return 'RgbColor'; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any fromJsonObject(jsonObject: any, version: number): RgbColor { switch (version) { case 1: @@ -96,6 +97,7 @@ export class RgbColor { this.b = buffer.readUInt8(); } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private fromJsonV6(jsonObject: any): void { this.b = jsonObject.b; this.g = jsonObject.g; diff --git a/packages/uhk-common/src/config-serializer/config-items/scancode-checker.ts b/packages/uhk-common/src/config-serializer/config-items/scancode-checker.ts index 6d08d0fdb9b..3fdd13b86da 100644 --- a/packages/uhk-common/src/config-serializer/config-items/scancode-checker.ts +++ b/packages/uhk-common/src/config-serializer/config-items/scancode-checker.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ + import { KeystrokeAction, KeystrokeType, SCANCODES } from './index.js'; let scancodeMap: Map; diff --git a/packages/uhk-common/src/config-serializer/config-items/user-configuration.test.ts b/packages/uhk-common/src/config-serializer/config-items/user-configuration.test.ts index e5575f2a6fa..996f3a32783 100644 --- a/packages/uhk-common/src/config-serializer/config-items/user-configuration.test.ts +++ b/packages/uhk-common/src/config-serializer/config-items/user-configuration.test.ts @@ -251,6 +251,7 @@ describe('user-configuration', () => { }); +// eslint-disable-next-line @typescript-eslint/no-explicit-any function jsonTester(assert: TestContextAssert, json: any): void { const orig = JSON.parse(JSON.stringify(json)); const config = new UserConfiguration(); diff --git a/packages/uhk-common/src/config-serializer/config-items/user-configuration.ts b/packages/uhk-common/src/config-serializer/config-items/user-configuration.ts index 4d99d1f5b7e..889dd6a9891 100644 --- a/packages/uhk-common/src/config-serializer/config-items/user-configuration.ts +++ b/packages/uhk-common/src/config-serializer/config-items/user-configuration.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { assertEnum, assertFloat, assertInt16, assertUInt16, assertUInt32, assertUInt8 } from '../assert.js'; import { resolveSwitchKeymapActions } from '../resolve-switch-keymap-actions.js'; import { UhkBuffer } from '../uhk-buffer.js'; diff --git a/packages/uhk-common/src/config-serializer/uhk-buffer.ts b/packages/uhk-common/src/config-serializer/uhk-buffer.ts index fd83bdc1709..bd813932941 100644 --- a/packages/uhk-common/src/config-serializer/uhk-buffer.ts +++ b/packages/uhk-common/src/config-serializer/uhk-buffer.ts @@ -4,6 +4,7 @@ import { Buffer } from '../buffer.js'; export class UhkBuffer { static simpleElementWriter(buffer: UhkBuffer, element: T): void { + // eslint-disable-next-line @typescript-eslint/no-explicit-any (element).toBinary(buffer); // TODO: Remove any } @@ -245,7 +246,7 @@ export class UhkBuffer { this._enableDump = value; } - dump(value: any) { + dump(value: string) { if (!this.enableDump) { return; } diff --git a/packages/uhk-common/src/log/logger.service.ts b/packages/uhk-common/src/log/logger.service.ts index 8f1f7161a7f..440ef618aa4 100644 --- a/packages/uhk-common/src/log/logger.service.ts +++ b/packages/uhk-common/src/log/logger.service.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { LogOptions } from '../models/log-options.js'; import { UserConfiguration } from '../config-serializer/config-items/user-configuration.js'; import { logUserConfigHelper } from './log-user-config-helper.js'; diff --git a/packages/uhk-common/src/models/notification.ts b/packages/uhk-common/src/models/notification.ts index bca461f5cc4..ab9bf4c6f10 100644 --- a/packages/uhk-common/src/models/notification.ts +++ b/packages/uhk-common/src/models/notification.ts @@ -11,5 +11,5 @@ export interface Notification { type: NotificationType; title?: string; message: string; - extra?: any; + extra?: unknown; } diff --git a/packages/uhk-common/src/util/helpers.ts b/packages/uhk-common/src/util/helpers.ts index 71468bc63d7..8e5482e9308 100644 --- a/packages/uhk-common/src/util/helpers.ts +++ b/packages/uhk-common/src/util/helpers.ts @@ -72,6 +72,7 @@ export const getUserConfigFromDeviceResponse = (json: string): ParsedUserConfigu } }; +// eslint-disable-next-line @typescript-eslint/no-explicit-any export const getUserConfigFromJsonObject = (data: any): UserConfiguration => { const userConfig = new UserConfiguration(); userConfig.fromJsonObject(data); @@ -83,6 +84,7 @@ export const getUserConfigFromJsonObject = (data: any): UserConfiguration => { throw Error('JSON string is an invalid user configuration'); }; +// eslint-disable-next-line @typescript-eslint/no-explicit-any export const mapObjectToUserConfigBinaryBuffer = (obj: any): Buffer => { const configuration = new UserConfiguration(); configuration.fromJsonObject(obj); diff --git a/packages/uhk-common/src/util/index.ts b/packages/uhk-common/src/util/index.ts index adcd2de5165..eb8dc298479 100644 --- a/packages/uhk-common/src/util/index.ts +++ b/packages/uhk-common/src/util/index.ts @@ -42,5 +42,6 @@ export function capitalizeFirstLetter(text: string): string { } export function runInElectron(): boolean { + // eslint-disable-next-line @typescript-eslint/no-explicit-any return !!(window as any)?.electron; } diff --git a/packages/uhk-common/src/util/is-equal-array.ts b/packages/uhk-common/src/util/is-equal-array.ts index ab669c4397c..8571acf3f33 100644 --- a/packages/uhk-common/src/util/is-equal-array.ts +++ b/packages/uhk-common/src/util/is-equal-array.ts @@ -1,6 +1,6 @@ import isEqual from 'lodash.isequal'; -export const isEqualArray = (arr1: Array, arr2: Array): boolean => { +export const isEqualArray = (arr1: Array, arr2: Array): boolean => { if (arr1.length !== arr2.length) { return false; } diff --git a/packages/uhk-common/test/serializer-test-helper.ts b/packages/uhk-common/test/serializer-test-helper.ts index d30a7ba7d46..a6294b38779 100644 --- a/packages/uhk-common/test/serializer-test-helper.ts +++ b/packages/uhk-common/test/serializer-test-helper.ts @@ -3,6 +3,7 @@ import { TestContextAssert } from 'node:test'; import { SerialisationInfo } from '../src/config-serializer/config-items/serialisation-info.js'; import { UhkBuffer } from '../src/config-serializer/uhk-buffer.js'; +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function jsonDefaultHelper(assert: TestContextAssert, baseObject: any, serialisationInfo: SerialisationInfo, serializationParam?: any, deserializationParam?: any): void { const json = baseObject.toJsonObject(serialisationInfo, serializationParam); const newObject = new baseObject.constructor; @@ -10,6 +11,7 @@ export function jsonDefaultHelper(assert: TestContextAssert, baseObject: any, se assert.deepStrictEqual(newObject, baseObject); } +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function binaryDefaultHelper(assert: TestContextAssert, baseObject: any, serialisationInfo: SerialisationInfo, serializerParam?: any, deserializationParam?: any): void { const buffer = new UhkBuffer(); baseObject.toBinary(buffer, serialisationInfo, serializerParam); diff --git a/packages/uhk-usb/src/uhk-hid-device.ts b/packages/uhk-usb/src/uhk-hid-device.ts index 1ad079fd678..7c357c3b0a2 100644 --- a/packages/uhk-usb/src/uhk-hid-device.ts +++ b/packages/uhk-usb/src/uhk-hid-device.ts @@ -590,7 +590,7 @@ export class UhkHidDevice { throw new Error(`Could not reenumerate as ${reenumMode}`); } - async sendKbootCommandToModule(module: ModuleSlotToI2cAddress, command: KbootCommands, maxTry = 1): Promise { + async sendKbootCommandToModule(module: ModuleSlotToI2cAddress, command: KbootCommands, maxTry = 1): Promise { let transfer; this.logService.usbOps(`[UhkHidDevice] USB[T]: Send KbootCommand ${mapI2cAddressToModuleName(module)} ${KbootCommands[command].toString()}`); if (command === KbootCommands.idle) { @@ -781,7 +781,7 @@ export class UhkHidDevice { const device = await HIDAsync.open(this._deviceInfo.path); if (this.options['usb-non-blocking']) { this.logService.misc('[UhkHidDevice] set non blocking communication mode'); - await this._device.setNonBlocking(1 as any); + await this._device.setNonBlocking(true); } this.logService.misc('[UhkHidDevice] Used device:', JSON.stringify(this._deviceInfo, usbDeviceJsonFormatter)); return device; diff --git a/packages/uhk-usb/src/uhk-operations.ts b/packages/uhk-usb/src/uhk-operations.ts index fe5575f2831..c382c094916 100644 --- a/packages/uhk-usb/src/uhk-operations.ts +++ b/packages/uhk-usb/src/uhk-operations.ts @@ -398,6 +398,7 @@ export class UhkOperations { try { this.logService.usbOps('[DeviceOperation] USB[T]: Write user configuration to keyboard'); let shouldRecalculateLength = false; + // eslint-disable-next-line @typescript-eslint/no-explicit-any const uhkBuffer = UhkBuffer.fromArray(buffer as any) const userConfiguration = new UserConfiguration() userConfiguration.fromBinary(uhkBuffer) diff --git a/packages/uhk-usb/src/util.ts b/packages/uhk-usb/src/util.ts index 04345a3a69e..80325167a2d 100644 --- a/packages/uhk-usb/src/util.ts +++ b/packages/uhk-usb/src/util.ts @@ -58,7 +58,7 @@ export function bufferToString(buffer: Array | Buffer | globalThis.Buffe return str; } -export async function retry(command: Function, maxTry = 3, logService?: LogService): Promise { +export async function retry(command: Function, maxTry = 3, logService?: LogService): Promise { let retryCount = 0; while (true) { @@ -119,7 +119,7 @@ export const getFileContentAsync = async (filePath: string): Promise !x.startsWith('#') && x.length > 0); }; -export const readBootloaderFirmwareFromHexFileAsync = async (hexFilePath: string): Promise> => { +export const readBootloaderFirmwareFromHexFileAsync = async (hexFilePath: string): Promise => { const fileContent = await fse.readFile(hexFilePath, { encoding: 'utf8' }); const memoryMap = MemoryMap.fromHex(fileContent); diff --git a/packages/uhk-usb/src/utils/get-firmware-package-json.ts b/packages/uhk-usb/src/utils/get-firmware-package-json.ts index ff1169e7193..20bd66e8c73 100644 --- a/packages/uhk-usb/src/utils/get-firmware-package-json.ts +++ b/packages/uhk-usb/src/utils/get-firmware-package-json.ts @@ -22,6 +22,7 @@ export async function getFirmwarePackageJson(firmwarePathData: TmpFirmware): Pro return packageJson; } +// eslint-disable-next-line @typescript-eslint/no-explicit-any async function checkPackageJsonSection(packageJson: any, sectionName: string, firmwareDir: string): Promise { const section = packageJson[sectionName]; diff --git a/packages/uhk-usb/src/utils/get-package-json-from-path-async.ts b/packages/uhk-usb/src/utils/get-package-json-from-path-async.ts index 8929dede806..35b5cd6cc79 100644 --- a/packages/uhk-usb/src/utils/get-package-json-from-path-async.ts +++ b/packages/uhk-usb/src/utils/get-package-json-from-path-async.ts @@ -1,5 +1,6 @@ import * as fs from 'fs'; +// eslint-disable-next-line @typescript-eslint/no-explicit-any export const getPackageJsonFromPathAsync = async (filePath: string): Promise => { return new Promise((resolve, reject) => { fs.readFile(filePath, {encoding: 'utf-8'}, (err, data) => { @@ -7,6 +8,7 @@ export const getPackageJsonFromPathAsync = async (filePath: string): Promise, private route: ActivatedRoute, diff --git a/packages/uhk-web/src/app/app.routes.ts b/packages/uhk-web/src/app/app.routes.ts index 93faaf902c8..fb4427c75e9 100644 --- a/packages/uhk-web/src/app/app.routes.ts +++ b/packages/uhk-web/src/app/app.routes.ts @@ -77,6 +77,6 @@ const appRoutes: Routes = [ } ]; -export const appRoutingProviders: any[] = []; +export const appRoutingProviders = []; export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes, { useHash: true }); diff --git a/packages/uhk-web/src/app/components/add-on/add-on.component.ts b/packages/uhk-web/src/app/components/add-on/add-on.component.ts index a78a8583319..7f7ff951476 100644 --- a/packages/uhk-web/src/app/components/add-on/add-on.component.ts +++ b/packages/uhk-web/src/app/components/add-on/add-on.component.ts @@ -99,6 +99,7 @@ export class AddOnComponent implements OnDestroy { this.subscription.unsubscribe(); } + // eslint-disable-next-line @typescript-eslint/no-explicit-any onSetModuleConfigurationValue(propertyName: string, value: any) { this.store.dispatch(new SetModuleConfigurationValueAction({ moduleId: this.moduleConfiguration.id, diff --git a/packages/uhk-web/src/app/components/auto-grow-input/auto-grow-input.component.ts b/packages/uhk-web/src/app/components/auto-grow-input/auto-grow-input.component.ts index 39c849b5ca5..a80835fb531 100644 --- a/packages/uhk-web/src/app/components/auto-grow-input/auto-grow-input.component.ts +++ b/packages/uhk-web/src/app/components/auto-grow-input/auto-grow-input.component.ts @@ -14,7 +14,7 @@ import { import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import * as util from '../../util'; -const noop = (_: any) => { +const noop: Function = () => { }; @Component({ @@ -84,11 +84,11 @@ export class AutoGrowInputComponent implements ControlValueAccessor, AfterViewIn } } - registerOnChange(fn: any): void { + registerOnChange(fn: Function): void { this._onChanged = fn; } - registerOnTouched(fn: any): void { + registerOnTouched(fn: Function): void { this._onTouched = fn; } @@ -106,7 +106,7 @@ export class AutoGrowInputComponent implements ControlValueAccessor, AfterViewIn this.calculateTextWidth(this._model); } - writeValue(obj: any): void { + writeValue(obj: string): void { if (this.model === obj) { return; } diff --git a/packages/uhk-web/src/app/components/circle-tooltip/circle-tooltip.component.ts b/packages/uhk-web/src/app/components/circle-tooltip/circle-tooltip.component.ts index 2ffd2a9154d..30a25e83524 100644 --- a/packages/uhk-web/src/app/components/circle-tooltip/circle-tooltip.component.ts +++ b/packages/uhk-web/src/app/components/circle-tooltip/circle-tooltip.component.ts @@ -11,7 +11,7 @@ import { PlacementArray } from '@ng-bootstrap/ng-bootstrap'; export default class CircleTooltipComponent { @Input() container: string | null | undefined; @Input() placement: PlacementArray = ['bottom', 'top']; - @Input() tooltip: string | TemplateRef | null | undefined; + @Input() tooltip: string | TemplateRef | null | undefined; @Input() tooltipClass: string | null | undefined; @Input() width: number | null | undefined; diff --git a/packages/uhk-web/src/app/components/device/led-settings/fade-timeout-slider.component.ts b/packages/uhk-web/src/app/components/device/led-settings/fade-timeout-slider.component.ts index f3d39a56805..b8dc1f7f8d4 100644 --- a/packages/uhk-web/src/app/components/device/led-settings/fade-timeout-slider.component.ts +++ b/packages/uhk-web/src/app/components/device/led-settings/fade-timeout-slider.component.ts @@ -2,7 +2,7 @@ import { forwardRef } from '@angular/core'; import { ChangeDetectionStrategy, ChangeDetectorRef, Component } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; -const noop = (_: any) => { +const noop: Function = () => { }; @Component({ @@ -100,7 +100,7 @@ export class FadeTimeoutSliderComponent implements ControlValueAccessor{ constructor(private _cdRef: ChangeDetectorRef) { } - writeValue(obj: any): void { + writeValue(obj: string): void { if (this.model === obj) { return; } @@ -108,11 +108,11 @@ export class FadeTimeoutSliderComponent implements ControlValueAccessor{ this._model = obj; } - registerOnChange(fn: any): void { + registerOnChange(fn: Function): void { this._onChanged = fn; } - registerOnTouched(fn: any): void { + registerOnTouched(fn: Function): void { this._onTouched = fn; } diff --git a/packages/uhk-web/src/app/components/editable-text/editable-text.component.ts b/packages/uhk-web/src/app/components/editable-text/editable-text.component.ts index 59d902e4aed..a7953f29f5d 100644 --- a/packages/uhk-web/src/app/components/editable-text/editable-text.component.ts +++ b/packages/uhk-web/src/app/components/editable-text/editable-text.component.ts @@ -34,7 +34,7 @@ export class EditableTextComponent implements ControlValueAccessor { } - writeValue(obj: any): void { + writeValue(obj: string): void { if (this.text === obj) { return; } @@ -43,11 +43,11 @@ export class EditableTextComponent implements ControlValueAccessor { this.cdr.markForCheck(); } - registerOnChange(fn: any): void { + registerOnChange(fn: Function): void { this.textChange = fn; } - registerOnTouched(fn: any): void { + registerOnTouched(fn: Function): void { } saveText(): void { @@ -82,6 +82,6 @@ export class EditableTextComponent implements ControlValueAccessor { return !this.editing && !!this.text; } - private textChange: any = () => { + private textChange: Function = () => { }; } diff --git a/packages/uhk-web/src/app/components/macro/action-editor/tab/command/macro-command-editor.component.ts b/packages/uhk-web/src/app/components/macro/action-editor/tab/command/macro-command-editor.component.ts index 113701cda6b..66e326bc1a7 100644 --- a/packages/uhk-web/src/app/components/macro/action-editor/tab/command/macro-command-editor.component.ts +++ b/packages/uhk-web/src/app/components/macro/action-editor/tab/command/macro-command-editor.component.ts @@ -30,6 +30,7 @@ import { SmartMacroDocCommandAction, SmartMacroDocService } from '../../../../.. const MACRO_CHANGE_DEBOUNCE_TIME = 250; function getVsCodeTheme(): string { + // eslint-disable-next-line @typescript-eslint/no-explicit-any return (window as any).getUhkTheme() === 'dark' ? 'uhk-dark' : 'uhk-light'; } @@ -181,8 +182,8 @@ export class MacroCommandEditorComponent implements AfterViewInit, ControlValueA this.subscriptions.unsubscribe(); } - private onChanged = (_: any) => {}; - private onTouched = () => {}; + private onChanged: Function = () => {}; + private onTouched: Function = () => {}; onEditorInit(editor: MonacoStandaloneCodeEditor) { this.logService.misc('[MacroCommandEditorComponent] editor initialized.'); @@ -285,11 +286,11 @@ export class MacroCommandEditorComponent implements AfterViewInit, ControlValueA this.changeObserver$.next(value); } - registerOnChange(fn: any): void { + registerOnChange(fn: Function): void { this.onChanged = fn; } - registerOnTouched(fn: any): void { + registerOnTouched(fn: Function): void { this.onTouched = fn; } diff --git a/packages/uhk-web/src/app/components/macro/action-editor/tab/key/macro-key.component.ts b/packages/uhk-web/src/app/components/macro/action-editor/tab/key/macro-key.component.ts index 8a79d621afd..9c9ad751321 100644 --- a/packages/uhk-web/src/app/components/macro/action-editor/tab/key/macro-key.component.ts +++ b/packages/uhk-web/src/app/components/macro/action-editor/tab/key/macro-key.component.ts @@ -38,6 +38,7 @@ export class MacroKeyTabComponent extends MacroBaseComponent implements OnInit { if (!this.macroAction) { this.macroAction = new KeyMacroAction(); } + // eslint-disable-next-line @typescript-eslint/no-explicit-any this.defaultKeyAction = new KeystrokeAction(this.macroAction); this.selectTab(this.getTabName(this.macroAction)); } @@ -75,6 +76,7 @@ export class MacroKeyTabComponent extends MacroBaseComponent implements OnInit { } getKeyMacroAction(): KeyMacroAction { + // eslint-disable-next-line @typescript-eslint/no-explicit-any const keyMacroAction = new KeyMacroAction(this.keypressTab.toKeyAction() as any); keyMacroAction.action = this.getActionType(this.activeTab); return keyMacroAction; diff --git a/packages/uhk-web/src/app/components/macro/item/macro-item.component.ts b/packages/uhk-web/src/app/components/macro/item/macro-item.component.ts index dcebc25a449..c9198ba2498 100644 --- a/packages/uhk-web/src/app/components/macro/item/macro-item.component.ts +++ b/packages/uhk-web/src/app/components/macro/item/macro-item.component.ts @@ -234,6 +234,7 @@ export class MacroItemComponent implements OnInit, OnChanges { } private setMouseMoveScrollActionContent(action: MacroAction): void { + // eslint-disable-next-line @typescript-eslint/no-explicit-any let typedAction: any; if (action instanceof MoveMouseMacroAction) { // Move mouse pointer diff --git a/packages/uhk-web/src/app/components/popover/popover.component.ts b/packages/uhk-web/src/app/components/popover/popover.component.ts index 22dfe550da7..c7eb0c1ecb9 100644 --- a/packages/uhk-web/src/app/components/popover/popover.component.ts +++ b/packages/uhk-web/src/app/components/popover/popover.component.ts @@ -87,7 +87,7 @@ export class PopoverComponent implements OnChanges { @Input() secondaryRoleOptions: SelectOptionData[]; @Input() selectedKey: SelectedKeyModel; - @Output() cancel = new EventEmitter(); + @Output() cancel = new EventEmitter(); @Output() remap = new EventEmitter(); @ViewChild('tab', { static: false }) selectedTab: Tab; @@ -200,7 +200,7 @@ export class PopoverComponent implements OnChanges { } onCancelClick(): void { - this.cancel.emit(undefined); + this.cancel.emit(); } onRemapKey(assignNewMacro?: boolean, navigateToMacro?: boolean): void { diff --git a/packages/uhk-web/src/app/components/popover/tab/keypress/keypress-tab.component.ts b/packages/uhk-web/src/app/components/popover/tab/keypress/keypress-tab.component.ts index 79bd8a888b7..2821f600042 100644 --- a/packages/uhk-web/src/app/components/popover/tab/keypress/keypress-tab.component.ts +++ b/packages/uhk-web/src/app/components/popover/tab/keypress/keypress-tab.component.ts @@ -24,6 +24,7 @@ interface FlatOptions { id: string; text: string; group?: string; + // eslint-disable-next-line @typescript-eslint/no-explicit-any additional?: any; } diff --git a/packages/uhk-web/src/app/components/side-menu/second-side-menu-container.component.ts b/packages/uhk-web/src/app/components/side-menu/second-side-menu-container.component.ts index 7c86c5a3576..23c17b298f5 100644 --- a/packages/uhk-web/src/app/components/side-menu/second-side-menu-container.component.ts +++ b/packages/uhk-web/src/app/components/side-menu/second-side-menu-container.component.ts @@ -19,6 +19,7 @@ export class SecondSideMenuContainerComponent { constructor(private componentFactoryResolver: ComponentFactoryResolver, private cdRef: ChangeDetectorRef) { } + // eslint-disable-next-line @typescript-eslint/no-explicit-any resolveComponent(component: any): void { this.container.clear(); const componentFactory = this.componentFactoryResolver.resolveComponentFactory(component); diff --git a/packages/uhk-web/src/app/components/slider-wrapper/slider-wrapper.component.ts b/packages/uhk-web/src/app/components/slider-wrapper/slider-wrapper.component.ts index 94b1cde67d1..98b9385d870 100644 --- a/packages/uhk-web/src/app/components/slider-wrapper/slider-wrapper.component.ts +++ b/packages/uhk-web/src/app/components/slider-wrapper/slider-wrapper.component.ts @@ -31,6 +31,7 @@ export interface SliderProps { }) export class SliderWrapperComponent implements ControlValueAccessor, OnDestroy { @ViewChild(NouisliderComponent, { static: false }) slider: NouisliderComponent; + // eslint-disable-next-line @typescript-eslint/no-explicit-any @Input() config: any = {}; @Input() label: string; @Input() tooltip: string; @@ -39,7 +40,9 @@ export class SliderWrapperComponent implements ControlValueAccessor, OnDestroy { @Input() max: number; @Input() step: number; @Input() pips: SliderPips; + // eslint-disable-next-line @typescript-eslint/no-explicit-any @Input() range: any; + // eslint-disable-next-line @typescript-eslint/no-explicit-any @Input() tooltips: Array = [true]; @Input() valueFormatter: Function; @Input() valueUnit: string; @@ -65,7 +68,7 @@ export class SliderWrapperComponent implements ControlValueAccessor, OnDestroy { : value; } - registerOnChange(fn: any): void { + registerOnChange(fn: Function): void { this.propagateChange = fn; } @@ -105,5 +108,5 @@ export class SliderWrapperComponent implements ControlValueAccessor, OnDestroy { return this.sanitizer.bypassSecurityTrustHtml(this.tooltip); } - private propagateChange: any = () => {}; + private propagateChange: Function = () => {}; } diff --git a/packages/uhk-web/src/app/components/svg/keys/svg-icon-text-key/svg-icon-text-key.component.ts b/packages/uhk-web/src/app/components/svg/keys/svg-icon-text-key/svg-icon-text-key.component.ts index 666e5db7227..132f71556fc 100644 --- a/packages/uhk-web/src/app/components/svg/keys/svg-icon-text-key/svg-icon-text-key.component.ts +++ b/packages/uhk-web/src/app/components/svg/keys/svg-icon-text-key/svg-icon-text-key.component.ts @@ -53,9 +53,9 @@ export class SvgIconTextKeyComponent implements OnChanges { } if (this.iconText) { - const style: CSSStyleDeclaration = { + const style: Partial = { font: `${this.iconTextFontSize}px Helvetica` - } as any; + }; iconTextWidth = getContentWidth(style, this.iconText); } @@ -128,9 +128,9 @@ export class SvgIconTextKeyComponent implements OnChanges { } private getText(startPosition: number): string { - const style: CSSStyleDeclaration = { + const style: Partial = { font: `${this.fontSize}px Helvetica` - } as any; + }; let result = ''; let lastSpacePosition = 0; diff --git a/packages/uhk-web/src/app/components/svg/keys/svg-keyboard-key/svg-keyboard-key.component.ts b/packages/uhk-web/src/app/components/svg/keys/svg-keyboard-key/svg-keyboard-key.component.ts index bd3c4865ba6..11f8984724b 100644 --- a/packages/uhk-web/src/app/components/svg/keys/svg-keyboard-key/svg-keyboard-key.component.ts +++ b/packages/uhk-web/src/app/components/svg/keys/svg-keyboard-key/svg-keyboard-key.component.ts @@ -126,6 +126,7 @@ export class SvgKeyboardKeyComponent implements OnChanges, OnDestroy { recording: boolean; labelType: LabelTypes; + // eslint-disable-next-line @typescript-eslint/no-explicit-any labelSource: any; secondaryText: string; textColor: string; diff --git a/packages/uhk-web/src/app/components/svg/keys/svg-keyboard-key/svg-keyboard-key.model.ts b/packages/uhk-web/src/app/components/svg/keys/svg-keyboard-key/svg-keyboard-key.model.ts index cd367661db8..8f3f127ca1d 100644 --- a/packages/uhk-web/src/app/components/svg/keys/svg-keyboard-key/svg-keyboard-key.model.ts +++ b/packages/uhk-web/src/app/components/svg/keys/svg-keyboard-key/svg-keyboard-key.model.ts @@ -14,5 +14,6 @@ export interface SvgKeyboardKey { transform?: string; type: 'circle' | 'path' | 'rec' | 'g'; textTransform?: string; + // eslint-disable-next-line @typescript-eslint/no-explicit-any elements?: { paths?: Array, circles?: Array }; } diff --git a/packages/uhk-web/src/app/components/svg/keys/svg-keystroke-key/svg-keystroke-key.component.ts b/packages/uhk-web/src/app/components/svg/keys/svg-keystroke-key/svg-keystroke-key.component.ts index 9db4b57ab52..2182ef5fae1 100644 --- a/packages/uhk-web/src/app/components/svg/keys/svg-keystroke-key/svg-keystroke-key.component.ts +++ b/packages/uhk-web/src/app/components/svg/keys/svg-keystroke-key/svg-keystroke-key.component.ts @@ -43,6 +43,7 @@ export class SvgKeystrokeKeyComponent implements OnChanges { option: SvgAttributes; command: SvgAttributes; + // eslint-disable-next-line @typescript-eslint/no-explicit-any labelSource: any; labelType: 'empty' | 'one-line' | 'two-line' | 'icon' | 'icon-text' | 'text-icon'; diff --git a/packages/uhk-web/src/app/components/svg/keys/svg-mouse-key/svg-mouse-key.ts b/packages/uhk-web/src/app/components/svg/keys/svg-mouse-key/svg-mouse-key.ts index 2c28d490249..6e5b00162ef 100644 --- a/packages/uhk-web/src/app/components/svg/keys/svg-mouse-key/svg-mouse-key.ts +++ b/packages/uhk-web/src/app/components/svg/keys/svg-mouse-key/svg-mouse-key.ts @@ -11,6 +11,7 @@ import { MouseAction, MouseActionParam } from 'uhk-common'; export class SvgMouseKeyComponent implements OnChanges { @Input() mouseAction: MouseAction; type: 'click' | 'scroll' | 'move' | 'speed'; + // eslint-disable-next-line @typescript-eslint/no-explicit-any param: any; constructor() { } diff --git a/packages/uhk-web/src/app/components/svg/keys/svg-secondary-role/svg-secondary-role.component.ts b/packages/uhk-web/src/app/components/svg/keys/svg-secondary-role/svg-secondary-role.component.ts index fcd39602c39..830788f0792 100644 --- a/packages/uhk-web/src/app/components/svg/keys/svg-secondary-role/svg-secondary-role.component.ts +++ b/packages/uhk-web/src/app/components/svg/keys/svg-secondary-role/svg-secondary-role.component.ts @@ -9,9 +9,9 @@ import { import { getContentWidth } from '../../../../util'; -const SECONDARY_STYLE: CSSStyleDeclaration = { +const SECONDARY_STYLE: Partial = { font: '12px Helvetica' -} as any; +}; @Component({ selector: 'g[svg-secondary-role]', diff --git a/packages/uhk-web/src/app/components/svg/module/svg-module.component.ts b/packages/uhk-web/src/app/components/svg/module/svg-module.component.ts index 73528a1a6af..1db0adb91e9 100644 --- a/packages/uhk-web/src/app/components/svg/module/svg-module.component.ts +++ b/packages/uhk-web/src/app/components/svg/module/svg-module.component.ts @@ -29,7 +29,9 @@ import { AppState, getHostConnections, getMacroMap } from '../../../store'; }) export class SvgModuleComponent implements OnDestroy { @Input() backlightingMode: BacklightingMode; + // eslint-disable-next-line @typescript-eslint/no-explicit-any @Input() coverages: any[]; + // eslint-disable-next-line @typescript-eslint/no-explicit-any @Input() circles: any[]; @Input() keyboardKeys: SvgKeyboardKey[]; @Input() keyActions: KeyAction[]; @@ -39,7 +41,9 @@ export class SvgModuleComponent implements OnDestroy { @Input() capturingEnabled: boolean; @Input() lastEdited: boolean; @Input() lastEditedKey: LastEditedKey; + // eslint-disable-next-line @typescript-eslint/no-explicit-any @Input() moduleNavCircle: any; + // eslint-disable-next-line @typescript-eslint/no-explicit-any @Input() moduleNavPath: any; @Output() keyClick = new EventEmitter(); @Output() keyHover = new EventEmitter(); diff --git a/packages/uhk-web/src/app/components/svg/module/svg-module.model.ts b/packages/uhk-web/src/app/components/svg/module/svg-module.model.ts index 0720b9dfdfb..a11180605b3 100644 --- a/packages/uhk-web/src/app/components/svg/module/svg-module.model.ts +++ b/packages/uhk-web/src/app/components/svg/module/svg-module.model.ts @@ -2,14 +2,18 @@ import { SvgKeyboardKey } from '../keys'; export class SvgModule { // circle svg elements that not programmable. Part of the coverages - circles: any[] = []; - coverages: any[] = []; + circles = []; + coverages = []; keyboardKeys: SvgKeyboardKey[]; + // eslint-disable-next-line @typescript-eslint/no-explicit-any attributes: any; id: number; + // eslint-disable-next-line @typescript-eslint/no-explicit-any moduleNavCircle: any; + // eslint-disable-next-line @typescript-eslint/no-explicit-any moduleNavPath: any; + // eslint-disable-next-line @typescript-eslint/no-explicit-any constructor(obj: { rect: any[], path: any[], $: Object, circle?: any[], g?: any[] }) { this.keyboardKeys = []; if (obj.rect) { @@ -149,7 +153,7 @@ function parseStyle(style: string): Record | undefined { return style .split(';') - .reduce((result: any, value: string) => { + .reduce((result: unknown, value: string) => { const split = value.split(':'); if (split.length < 2) { return result; diff --git a/packages/uhk-web/src/app/components/svg/separator/convert-xml-to-svg-separator.ts b/packages/uhk-web/src/app/components/svg/separator/convert-xml-to-svg-separator.ts index c3b3bab7ab3..4d6eb55c460 100644 --- a/packages/uhk-web/src/app/components/svg/separator/convert-xml-to-svg-separator.ts +++ b/packages/uhk-web/src/app/components/svg/separator/convert-xml-to-svg-separator.ts @@ -1,5 +1,6 @@ import { SvgSeparator } from './svg-separator.model'; +// eslint-disable-next-line @typescript-eslint/no-explicit-any export const convertXmlToSvgSeparator = (obj: { path: any[], $: Object }): SvgSeparator => { return obj.path[0].$; }; diff --git a/packages/uhk-web/src/app/components/uhk-header/uhk-header.ts b/packages/uhk-web/src/app/components/uhk-header/uhk-header.ts index 2c663868169..ca8061e2082 100644 --- a/packages/uhk-web/src/app/components/uhk-header/uhk-header.ts +++ b/packages/uhk-web/src/app/components/uhk-header/uhk-header.ts @@ -19,7 +19,7 @@ export class UhkHeader { this.undoableNotification$ = this.store.select(getUndoableNotification); } - onUndoLastNotification(data: any): void { + onUndoLastNotification(data: unknown): void { this.store.dispatch(new UndoLastAction(data)); } diff --git a/packages/uhk-web/src/app/models/firmware-upgrade-error.ts b/packages/uhk-web/src/app/models/firmware-upgrade-error.ts index e2582731158..81ba23d336c 100644 --- a/packages/uhk-web/src/app/models/firmware-upgrade-error.ts +++ b/packages/uhk-web/src/app/models/firmware-upgrade-error.ts @@ -1,6 +1,7 @@ import { HardwareModules } from 'uhk-common'; export interface FirmwareUpgradeError { + // eslint-disable-next-line @typescript-eslint/no-explicit-any error: any; modules?: HardwareModules; } diff --git a/packages/uhk-web/src/app/models/select-option-data.ts b/packages/uhk-web/src/app/models/select-option-data.ts index cf3e99d547d..1db45828c22 100644 --- a/packages/uhk-web/src/app/models/select-option-data.ts +++ b/packages/uhk-web/src/app/models/select-option-data.ts @@ -3,5 +3,6 @@ export interface SelectOptionData { text: string; disabled?: boolean; children?: Array; + // eslint-disable-next-line @typescript-eslint/no-explicit-any additional?: any; } diff --git a/packages/uhk-web/src/app/models/set-module-configuration-value-payload.ts b/packages/uhk-web/src/app/models/set-module-configuration-value-payload.ts index 4f228d58c90..30be3690319 100644 --- a/packages/uhk-web/src/app/models/set-module-configuration-value-payload.ts +++ b/packages/uhk-web/src/app/models/set-module-configuration-value-payload.ts @@ -1,5 +1,6 @@ export interface SetModuleConfigurationValuePayload { moduleId: number; propertyName: string; + // eslint-disable-next-line @typescript-eslint/no-explicit-any value: any; } diff --git a/packages/uhk-web/src/app/services/app-update-renderer.service.ts b/packages/uhk-web/src/app/services/app-update-renderer.service.ts index 9870e97576f..9e40dbac004 100644 --- a/packages/uhk-web/src/app/services/app-update-renderer.service.ts +++ b/packages/uhk-web/src/app/services/app-update-renderer.service.ts @@ -38,6 +38,7 @@ export class AppUpdateRendererService { } private registerEvents() { + // eslint-disable-next-line @typescript-eslint/no-explicit-any this.ipcRenderer.on(IpcEvents.autoUpdater.updateAvailable, (event: string, arg: any) => { this.logService.misc(IpcEvents.autoUpdater.updateAvailable, arg); }); @@ -47,20 +48,25 @@ export class AppUpdateRendererService { this.dispatchStoreAction(new CheckForUpdateSuccessAction('No update available')); }); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any this.ipcRenderer.on(IpcEvents.autoUpdater.autoUpdateError, (event: string, arg: any) => { this.logService.misc(IpcEvents.autoUpdater.autoUpdateError, arg); this.dispatchStoreAction(new UpdateErrorAction(arg)); }); + // eslint-disable-next-line @typescript-eslint/no-explicit-any this.ipcRenderer.on(IpcEvents.autoUpdater.autoUpdateDownloadProgress, (event: string, arg: any) => { this.logService.misc(IpcEvents.autoUpdater.autoUpdateDownloadProgress, arg); }); + // eslint-disable-next-line @typescript-eslint/no-explicit-any this.ipcRenderer.on(IpcEvents.autoUpdater.autoUpdateDownloaded, (event: string, arg: any) => { this.logService.misc(IpcEvents.autoUpdater.autoUpdateDownloaded, arg); this.dispatchStoreAction(new UpdateDownloadedAction(arg)); }); + // eslint-disable-next-line @typescript-eslint/no-explicit-any this.ipcRenderer.on(IpcEvents.autoUpdater.checkForUpdateNotAvailable, (event: string, arg: any) => { this.logService.misc(IpcEvents.autoUpdater.checkForUpdateNotAvailable, arg); this.dispatchStoreAction(new CheckForUpdateFailedAction(arg)); diff --git a/packages/uhk-web/src/app/services/device-renderer.service.ts b/packages/uhk-web/src/app/services/device-renderer.service.ts index 1abd3617684..a3ff02a0f27 100644 --- a/packages/uhk-web/src/app/services/device-renderer.service.ts +++ b/packages/uhk-web/src/app/services/device-renderer.service.ts @@ -204,7 +204,7 @@ export class DeviceRendererService { this.dispachStoreAction(new DongleVersionInfoLoadedAction(response)); }); - this.ipcRenderer.on(IpcEvents.device.deleteHostConnectionSuccess, (event: string, data: any) => { + this.ipcRenderer.on(IpcEvents.device.deleteHostConnectionSuccess, (event: string, data: {index: number; address: string}) => { this.dispachStoreAction(new DeleteHostConnectionSuccessAction(data)); }); diff --git a/packages/uhk-web/src/app/services/ipc-common-renderer.ts b/packages/uhk-web/src/app/services/ipc-common-renderer.ts index d514507528c..85f44d6ba45 100644 --- a/packages/uhk-web/src/app/services/ipc-common-renderer.ts +++ b/packages/uhk-web/src/app/services/ipc-common-renderer.ts @@ -1,4 +1,5 @@ export class IpcCommonRenderer { + // eslint-disable-next-line @typescript-eslint/no-explicit-any send(channel: string, ...args: any[]): void { } diff --git a/packages/uhk-web/src/app/services/key-action-drag-and-drop.service.ts b/packages/uhk-web/src/app/services/key-action-drag-and-drop.service.ts index d4b9e1d6885..a53289c1861 100644 --- a/packages/uhk-web/src/app/services/key-action-drag-and-drop.service.ts +++ b/packages/uhk-web/src/app/services/key-action-drag-and-drop.service.ts @@ -132,6 +132,7 @@ export class KeyActionDragAndDropService implements OnDestroy { let parent = element.parentElement; while (parent) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any if (parent !== this.lefButtonDownOptions.element as any && parent.hasAttribute('svg-keyboard-key') ) { @@ -178,6 +179,7 @@ export class KeyActionDragAndDropService implements OnDestroy { this.setDropElementFillColor(this.dropElement.getAttribute(ORIGINAL_FILL_COLOR_ATTRIBUTE)); } + /* eslint-disable @typescript-eslint/no-explicit-any */ private setDropElementFillColor(fillColor: string): void { const colorPaletteIndex = this.dropElement.getAttribute(COLOR_PALETTE_BUTTON_INDEX_ATTRIBUTE); if (colorPaletteIndex === 'new') { @@ -189,6 +191,7 @@ export class KeyActionDragAndDropService implements OnDestroy { (this.dropElement as any).style.fill = fillColor; } } + /* eslint-enable @typescript-eslint/no-explicit-any */ private dragElement(): void { if (this.dragging) { diff --git a/packages/uhk-web/src/app/services/smart-macro-doc-service.ts b/packages/uhk-web/src/app/services/smart-macro-doc-service.ts index d98a4ad3d2d..21dea56585f 100644 --- a/packages/uhk-web/src/app/services/smart-macro-doc-service.ts +++ b/packages/uhk-web/src/app/services/smart-macro-doc-service.ts @@ -70,6 +70,7 @@ export class SmartMacroDocService implements OnDestroy { * Send message to the Smart Macro Doc. * If the smart macro has not been initialised then the message will be dropped */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any sendMessage(message: any): void { if (!this.iframe?.contentWindow) { return; @@ -111,6 +112,7 @@ export class SmartMacroDocService implements OnDestroy { } } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private dispatchSmartMacroDocCommand(action: SmartMacroDocCommandAction, data: any): void { if (!this.selectedMacroAction) { return; diff --git a/packages/uhk-web/src/app/store/actions/app-update.action.ts b/packages/uhk-web/src/app/store/actions/app-update.action.ts index 76d94fb61ce..c6f23fc290f 100644 --- a/packages/uhk-web/src/app/store/actions/app-update.action.ts +++ b/packages/uhk-web/src/app/store/actions/app-update.action.ts @@ -47,7 +47,7 @@ export class UpdatingAction implements Action { export class UpdateErrorAction implements Action { type = ActionTypes.UpdateError; - constructor(public payload: any) { + constructor(public payload: unknown) { } } diff --git a/packages/uhk-web/src/app/store/actions/app.ts b/packages/uhk-web/src/app/store/actions/app.ts index 4ec85f1d47a..63553d9aaba 100644 --- a/packages/uhk-web/src/app/store/actions/app.ts +++ b/packages/uhk-web/src/app/store/actions/app.ts @@ -84,7 +84,7 @@ export class ProcessAppStartInfoAction implements Action { export class UndoLastAction implements Action { type = ActionTypes.UndoLast; - constructor(public payload: any) { + constructor(public payload: unknown) { } } diff --git a/packages/uhk-web/src/app/store/actions/auto-update-settings.ts b/packages/uhk-web/src/app/store/actions/auto-update-settings.ts index db698c6146d..c7687892094 100644 --- a/packages/uhk-web/src/app/store/actions/auto-update-settings.ts +++ b/packages/uhk-web/src/app/store/actions/auto-update-settings.ts @@ -31,7 +31,7 @@ export class CheckForUpdateSuccessAction implements Action { export class CheckForUpdateFailedAction implements Action { type = ActionTypes.CheckForUpdateFailed; - constructor(public payload: any) { + constructor(public payload: unknown) { } } diff --git a/packages/uhk-web/src/app/store/effects/app.ts b/packages/uhk-web/src/app/store/effects/app.ts index b054a38bd0e..6180b68ae6b 100644 --- a/packages/uhk-web/src/app/store/effects/app.ts +++ b/packages/uhk-web/src/app/store/effects/app.ts @@ -164,7 +164,9 @@ export class ApplicationEffects { ofType(ActionTypes.SetAppTheme), map(action => action.payload), tap(theme => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any if ((window as any).setUhkTheme) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any (window as any).setUhkTheme(theme); } }) diff --git a/packages/uhk-web/src/app/store/effects/default-user-configuration.effect.ts b/packages/uhk-web/src/app/store/effects/default-user-configuration.effect.ts index 7af8b387f2a..cb4f57136f7 100644 --- a/packages/uhk-web/src/app/store/effects/default-user-configuration.effect.ts +++ b/packages/uhk-web/src/app/store/effects/default-user-configuration.effect.ts @@ -33,6 +33,7 @@ export class DefaultUserConfigurationEffect { addKeymapNavigated$ = createEffect(() => this.actions$ .pipe( ofType(ROUTER_NAVIGATED), + // eslint-disable-next-line @typescript-eslint/no-explicit-any map(action => action.payload.routerState as any), filter(routerState => routerState.url.startsWith('/add-keymap')), map(routerState => routerState.params.newKeymapAbbr), diff --git a/packages/uhk-web/src/app/store/effects/device.ts b/packages/uhk-web/src/app/store/effects/device.ts index 8e64b1bd6a3..44c110bd149 100644 --- a/packages/uhk-web/src/app/store/effects/device.ts +++ b/packages/uhk-web/src/app/store/effects/device.ts @@ -286,13 +286,13 @@ export class DeviceEffects { .pipe( ofType(ActionTypes.SetPrivilegeOnLinuxReply), map(action => action.payload), - switchMap((response: any) => { + switchMap((response) => { if (response.success) { this.appRendererService.getAppStartInfo(); return EMPTY; } - return of(new SetupPermissionErrorAction(response.error)); + return of(new SetupPermissionErrorAction(response.error.message)); }) ) ); diff --git a/packages/uhk-web/src/app/store/effects/macro.ts b/packages/uhk-web/src/app/store/effects/macro.ts index 5016bcfadda..e4650594f35 100644 --- a/packages/uhk-web/src/app/store/effects/macro.ts +++ b/packages/uhk-web/src/app/store/effects/macro.ts @@ -18,6 +18,7 @@ export class MacroEffects { macroNavigated$ = createEffect(() => this.actions$ .pipe( ofType(routerNavigatedAction), + // eslint-disable-next-line @typescript-eslint/no-explicit-any map(action => (action.payload.routerState as any).params.macroId), distinctUntilChanged(), map(macroId => new SelectMacroAction(+macroId)) diff --git a/packages/uhk-web/src/app/store/effects/user-config.ts b/packages/uhk-web/src/app/store/effects/user-config.ts index 25c3294c913..39f07bf97e7 100644 --- a/packages/uhk-web/src/app/store/effects/user-config.ts +++ b/packages/uhk-web/src/app/store/effects/user-config.ts @@ -389,6 +389,7 @@ export class UserConfigEffects { moduleConfigurationNavigated$ = createEffect(() => this.actions$ .pipe( ofType(routerNavigatedAction), + // eslint-disable-next-line @typescript-eslint/no-explicit-any map(action => action.payload.routerState as any), filter(routerState => routerState.url.startsWith('/add-on')), map(routerState => { diff --git a/packages/uhk-web/src/app/store/reducers/app.reducer.ts b/packages/uhk-web/src/app/store/reducers/app.reducer.ts index 033ba61a9e7..63cc63500c9 100644 --- a/packages/uhk-web/src/app/store/reducers/app.reducer.ts +++ b/packages/uhk-web/src/app/store/reducers/app.reducer.ts @@ -31,7 +31,7 @@ export interface State { configLoading: boolean; hardwareConfig?: HardwareConfiguration; privilegeWhatWillThisDoClicked: boolean; - permissionError?: any; + permissionError?: unknown; platform?: string; osVersion?: string; keypressCapturing: boolean; diff --git a/packages/uhk-web/src/app/store/reducers/contributors.reducer.ts b/packages/uhk-web/src/app/store/reducers/contributors.reducer.ts index 2f8bfa44671..8d48240dd45 100644 --- a/packages/uhk-web/src/app/store/reducers/contributors.reducer.ts +++ b/packages/uhk-web/src/app/store/reducers/contributors.reducer.ts @@ -4,7 +4,7 @@ import { UHKContributor } from '../../models/uhk-contributor'; export interface State { isLoading: boolean; contributors: UHKContributor[]; - error?: any; + error?: unknown; } export const initialState: State = { diff --git a/packages/uhk-web/src/app/store/reducers/user-configuration.ts b/packages/uhk-web/src/app/store/reducers/user-configuration.ts index 0678ecdc8c8..954099fe30d 100644 --- a/packages/uhk-web/src/app/store/reducers/user-configuration.ts +++ b/packages/uhk-web/src/app/store/reducers/user-configuration.ts @@ -932,8 +932,10 @@ export function reducer( for (const fieldName of ADVANCED_SECONDARY_ROLE_CONFIGURATION_FIELD_NAMES) { // Save the old typings behavior config + // eslint-disable-next-line @typescript-eslint/no-explicit-any (customAdvancedSecondaryRoleConfiguration[fieldName] as any) = userConfiguration[fieldName]; // Apply the loaded typings behavior config + // eslint-disable-next-line @typescript-eslint/no-explicit-any (userConfiguration[fieldName] as any) = presetConfiguration[fieldName]; } @@ -1328,6 +1330,7 @@ export const selectedBacklightingColor = (state: State): RgbColorInterface => st export const selectedBacklightingColorIndex = (state: State): number => state.selectedBacklightingColorIndex; export const calculateTypingBehaviorPresets = (state: State): TypingBehaviorPreset[] => { const currentConfiguration = ADVANCED_SECONDARY_ROLE_CONFIGURATION_FIELD_NAMES.reduce((config, fieldName) => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any (config[fieldName] as any) = state.userConfiguration[fieldName]; return config; @@ -1467,6 +1470,7 @@ function insertItemInNameOrder( return newItems; } +// eslint-disable-next-line @typescript-eslint/no-explicit-any function checkExistence(layers: Layer[], property: string, value: any): Layer[] { const keyActionsToClear: { layerIdx: number, diff --git a/packages/uhk-web/src/app/util/default-uhk-theme-colors.ts b/packages/uhk-web/src/app/util/default-uhk-theme-colors.ts index e5b4a83f4e1..ec7f27a8239 100644 --- a/packages/uhk-web/src/app/util/default-uhk-theme-colors.ts +++ b/packages/uhk-web/src/app/util/default-uhk-theme-colors.ts @@ -1,5 +1,6 @@ import { UhkThemeColors } from 'uhk-common'; +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function defaultUhkThemeColors(theme = (window as any).getUhkTheme()): UhkThemeColors { if (theme === 'dark') { return { diff --git a/packages/uhk-web/src/app/util/html-helper.ts b/packages/uhk-web/src/app/util/html-helper.ts index 3c148c8615e..4e5edc87f03 100644 --- a/packages/uhk-web/src/app/util/html-helper.ts +++ b/packages/uhk-web/src/app/util/html-helper.ts @@ -1,6 +1,6 @@ let canvas: HTMLCanvasElement; -export function getContentWidth(style: CSSStyleDeclaration, text: string): number { +export function getContentWidth(style: Partial, text: string): number { if (!text) { return 0; } diff --git a/packages/uhk-web/src/app/util/status-buffer-parser.ts b/packages/uhk-web/src/app/util/status-buffer-parser.ts index 54a0d980631..58f4edd10f1 100644 --- a/packages/uhk-web/src/app/util/status-buffer-parser.ts +++ b/packages/uhk-web/src/app/util/status-buffer-parser.ts @@ -34,7 +34,7 @@ function splitToErrorBlocks(text: string): string[] { return errorBlocks; } -function transformToErrorBlock(macros: Macro[], block: string): any { +function transformToErrorBlock(macros: Macro[], block: string): string { const lines = block.split('\n'); if (lines.length < 4) { return escapeHtml(block); diff --git a/packages/uhk-web/src/polyfills.ts b/packages/uhk-web/src/polyfills.ts index 9e40a2fc9d5..91483a8b3e6 100644 --- a/packages/uhk-web/src/polyfills.ts +++ b/packages/uhk-web/src/polyfills.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ + /** * This file includes polyfills needed by Angular and is loaded before the app. * You can add your own extra polyfills to this file. diff --git a/packages/uhk-web/src/renderer/models/sender-message.ts b/packages/uhk-web/src/renderer/models/sender-message.ts deleted file mode 100644 index 3c9010094aa..00000000000 --- a/packages/uhk-web/src/renderer/models/sender-message.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Observer } from 'rxjs'; - -export interface SenderMessage { - buffer: Buffer; - observer: Observer; -} diff --git a/packages/uhk-web/src/renderer/services/electron-datastorage-repository.service.ts b/packages/uhk-web/src/renderer/services/electron-datastorage-repository.service.ts index 1edc969ec2b..693c832cf22 100644 --- a/packages/uhk-web/src/renderer/services/electron-datastorage-repository.service.ts +++ b/packages/uhk-web/src/renderer/services/electron-datastorage-repository.service.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { ApplicationSettings, IpcEvents, UhkDeviceProduct, UserConfiguration } from 'uhk-common'; import { Observable, from, of } from 'rxjs'; diff --git a/packages/uhk-web/src/renderer/services/electron-error-handler.service.ts b/packages/uhk-web/src/renderer/services/electron-error-handler.service.ts index 67eb962c6bc..df5d1b2e7c7 100644 --- a/packages/uhk-web/src/renderer/services/electron-error-handler.service.ts +++ b/packages/uhk-web/src/renderer/services/electron-error-handler.service.ts @@ -5,7 +5,7 @@ import { LogService } from 'uhk-common'; export class ElectronErrorHandlerService implements ErrorHandler { constructor(private logService: LogService) { } - handleError(error: any) { + handleError(error: unknown) { this.logService.error(error); } } diff --git a/packages/uhk-web/src/renderer/services/electron-log.service.ts b/packages/uhk-web/src/renderer/services/electron-log.service.ts index f5259633e9f..93739ef7182 100644 --- a/packages/uhk-web/src/renderer/services/electron-log.service.ts +++ b/packages/uhk-web/src/renderer/services/electron-log.service.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ + import { Injectable } from '@angular/core'; import * as log from 'electron-log/renderer'; import { LogService, logUserConfigHelper, UserConfiguration } from 'uhk-common'; diff --git a/packages/uhk-web/src/renderer/services/ipc-uhk-renderer.ts b/packages/uhk-web/src/renderer/services/ipc-uhk-renderer.ts index 79d64c953c4..7aa4f68a6db 100644 --- a/packages/uhk-web/src/renderer/services/ipc-uhk-renderer.ts +++ b/packages/uhk-web/src/renderer/services/ipc-uhk-renderer.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { IpcCommonRenderer } from '../../app/services/ipc-common-renderer'; export class IpcUhkRenderer implements IpcCommonRenderer {