diff --git a/eslint.config.mjs b/eslint.config.mjs index 2d6e4bcd..182cf2f3 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -6,6 +6,7 @@ import react from "eslint-plugin-react"; import prettier from "eslint-plugin-prettier"; import globals from "globals"; import tsParser from "@typescript-eslint/parser"; +import tsEslint from "@typescript-eslint/eslint-plugin"; import path from "node:path"; import { fileURLToPath } from "node:url"; import js from "@eslint/js"; @@ -29,6 +30,7 @@ export default [...fixupConfigRules(compat.extends( plugins: { react: fixupPluginRules(react), prettier: fixupPluginRules(prettier), + "@typescript-eslint": tsEslint, }, languageOptions: { @@ -49,7 +51,6 @@ export default [...fixupConfigRules(compat.extends( parserOptions: { version: 2018, - ecmaFeatures: { jsx: true, }, @@ -61,7 +62,16 @@ export default [...fixupConfigRules(compat.extends( usePrettierrc: true, }], - "no-unused-vars": "warn", + "no-unused-vars": "off", "react/prop-types": "warn", + "@typescript-eslint/no-unused-vars": [ + "warn", + { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_", + "caughtErrorsIgnorePattern": "^_", + "destructuredArrayIgnorePattern": "^_" + } + ], }, }]; \ No newline at end of file diff --git a/package.json b/package.json index cf659721..1d9aba73 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "@types/w3c-web-serial": "^1.0.2", "@types/w3c-web-usb": "^1.0.5", "@types/wicg-file-system-access": "^2020.9.7", - "@typescript-eslint/eslint-plugin": "^4.10.0", + "@typescript-eslint/eslint-plugin": "^7.13.0", "@typescript-eslint/parser": "^7.11.0", "@vitejs/plugin-react-swc": "^3.7.0", "babel-eslint": "^10.1.0", diff --git a/src/actions/firmware.action.ts b/src/actions/firmware.action.ts index 9f604530..51df5b71 100644 --- a/src/actions/firmware.action.ts +++ b/src/actions/firmware.action.ts @@ -135,8 +135,7 @@ export const firmwareActionsThunk = { (file: File): ThunkPromiseAction => async ( dispatch: ThunkDispatch, - // eslint-disable-next-line no-unused-vars - getState: () => RootState + _getState: () => RootState ) => { // eslint-disable-next-line no-undef const loadBinaryFile = (file: File): Promise => { diff --git a/src/actions/hid.action.ts b/src/actions/hid.action.ts index 193c82e8..5fe56b9d 100644 --- a/src/actions/hid.action.ts +++ b/src/actions/hid.action.ts @@ -454,8 +454,7 @@ export const hidActionsThunk = { (keyboard: IKeyboard): ThunkPromiseAction => async ( dispatch: ThunkDispatch, - // eslint-disable-next-line no-unused-vars - getState: () => RootState + _getState: () => RootState ) => { await keyboard.close(); dispatch(AppActions.updateSetupPhase(SetupPhase.keyboardNotSelected)); @@ -625,8 +624,7 @@ export const hidActionsThunk = { dispatch: ThunkDispatch, getState: () => RootState ) => { - // eslint-disable-next-line no-unused-vars - const { app, entities } = getState(); + const { entities } = getState(); const keyboard: IKeyboard = entities.keyboard!; const rows = entities.keyboardDefinition!.matrix.rows; diff --git a/src/actions/storage.action.ts b/src/actions/storage.action.ts index 5a53c5ff..44a04f4e 100644 --- a/src/actions/storage.action.ts +++ b/src/actions/storage.action.ts @@ -219,8 +219,7 @@ export const storageActionsThunk = { (keyboardDefinition: KeyboardDefinitionSchema): ThunkPromiseAction => async ( dispatch: ThunkDispatch, - // eslint-disable-next-line no-unused-vars - getState: () => RootState + _getState: () => RootState ) => { dispatch(StorageActions.updateKeyboardDefinition(keyboardDefinition)); dispatch( diff --git a/src/components/catalog/header/Header.tsx b/src/components/catalog/header/Header.tsx index 63f444b0..596abba5 100644 --- a/src/components/catalog/header/Header.tsx +++ b/src/components/catalog/header/Header.tsx @@ -22,14 +22,12 @@ class Header extends React.Component { super(props); } - // eslint-disable-next-line no-unused-vars - onClickBackButton(event: SyntheticEvent) { + onClickBackButton(_event: SyntheticEvent) { sendEventToGoogleAnalytics('catalog/back_to_search'); this.props.goToSearch!(); } - // eslint-disable-next-line no-unused-vars - onClickFlashFirmware(event: SyntheticEvent) { + onClickFlashFirmware(_event: SyntheticEvent) { this.props.openUploadFirmwareDialog!(); } diff --git a/src/components/catalog/keyboard/keymap/Catalogkeymap.tsx b/src/components/catalog/keyboard/keymap/Catalogkeymap.tsx index eb983597..a426ea1b 100644 --- a/src/components/catalog/keyboard/keymap/Catalogkeymap.tsx +++ b/src/components/catalog/keyboard/keymap/Catalogkeymap.tsx @@ -48,8 +48,7 @@ export default function CatalogKeymap(props: CatalogKeymapProps) { const navigate = useNavigate(); - // eslint-disable-next-line no-unused-vars - const onClickBackButton = (event: React.MouseEvent<{}>) => { + const _onClickBackButton = (_event: React.MouseEvent<{}>) => { // eslint-disable-next-line no-undef navigate('/catalog'); props.goToSearch!(); @@ -296,8 +295,7 @@ type LayerProps = { function Layer(props: LayerProps) { const layers = [...Array(props.layerCount)].map((_, i) => i); - // eslint-disable-next-line no-unused-vars - const invisiblePages = layers.map((layer) => true); + const invisiblePages = layers.map((_layer) => true); return (
{ +const mapStateToProps = (_state: RootState) => { return {}; }; export type AuthProviderDialogStateType = ReturnType; diff --git a/src/components/configure/importDef/ImportDefDialog.stories.tsx b/src/components/configure/importDef/ImportDefDialog.stories.tsx index 0c696658..845c1059 100644 --- a/src/components/configure/importDef/ImportDefDialog.stories.tsx +++ b/src/components/configure/importDef/ImportDefDialog.stories.tsx @@ -17,8 +17,7 @@ export default { ], }; -// eslint-disable-next-line no-unused-vars -const keyboardDefinition: KeyboardDefinitionSchema = { +const _keyboardDefinition: KeyboardDefinitionSchema = { name: 'Dummy', vendorId: hexadecimal(777), productId: hexadecimal(1), diff --git a/src/components/configure/keycodekey/any/AddAnyKeycodeKey.container.ts b/src/components/configure/keycodekey/any/AddAnyKeycodeKey.container.ts index 889f21dc..67498564 100644 --- a/src/components/configure/keycodekey/any/AddAnyKeycodeKey.container.ts +++ b/src/components/configure/keycodekey/any/AddAnyKeycodeKey.container.ts @@ -4,8 +4,7 @@ import { RootState } from '../../../../store/state'; import { AnyKeycodeKeyActions } from '../../../../actions/actions'; import { AnyKey } from '../KeycodeKey'; -// eslint-disable-next-line no-unused-vars -const mapStateToProps = (state: RootState) => { +const mapStateToProps = (_state: RootState) => { return {}; }; export type KeycodeAddKeyStateType = ReturnType; diff --git a/src/components/configure/keymap/Keymap.tsx b/src/components/configure/keymap/Keymap.tsx index 569fef41..95cf2745 100644 --- a/src/components/configure/keymap/Keymap.tsx +++ b/src/components/configure/keymap/Keymap.tsx @@ -220,8 +220,7 @@ export default class Keymap extends React.Component< componentDidUpdate( prevProps: KeymapPropsType, - // eslint-disable-next-line no-unused-vars - prevState: OwnKeymapStateType + _prevState: OwnKeymapStateType ) { if (prevProps.testMatrix !== this.props.testMatrix) { clearInterval(this.state.interval); diff --git a/src/components/configure/lighting/LightingDialog.tsx b/src/components/configure/lighting/LightingDialog.tsx index 229e19b7..de899706 100644 --- a/src/components/configure/lighting/LightingDialog.tsx +++ b/src/components/configure/lighting/LightingDialog.tsx @@ -56,12 +56,7 @@ export default class LightingDialog extends React.Component< this.state = {}; } - shouldComponentUpdate( - // eslint-disable-next-line no-unused-vars - nextProps: OwnProps, - // eslint-disable-next-line no-unused-vars - nextState: OwnState - ) { + shouldComponentUpdate(_nextProps: OwnProps, _nextState: OwnState) { this.initLighting(); return true; } diff --git a/src/components/configure/macroeditor/MacroEditor.tsx b/src/components/configure/macroeditor/MacroEditor.tsx index bd54a476..793c2cdc 100644 --- a/src/components/configure/macroeditor/MacroEditor.tsx +++ b/src/components/configure/macroeditor/MacroEditor.tsx @@ -1,5 +1,3 @@ -/* eslint-disable no-unused-vars */ -/* eslint-disable no-undef */ import React, { KeyboardEvent } from 'react'; import './MacroEditor.scss'; import { @@ -7,7 +5,7 @@ import { MacroEditorStateType, } from './MacroEditor.container'; import { Button } from '@mui/material'; -import { genKey, Key } from '../keycodekey/KeyGen'; +import { genKey } from '../keycodekey/KeyGen'; import { Hold, MacroHold, @@ -467,7 +465,7 @@ export default class MacroEditor extends React.Component< onDelete={(index) => { this.onDelete(index); }} - onChangeType={(index, type) => { + onChangeType={(index, _type) => { this.onToggleKeyType(index); }} onChangeDelay={(index, subIndex) => { diff --git a/src/components/keyboards/editdefinition/catalogform/CatalogForm.tsx b/src/components/keyboards/editdefinition/catalogform/CatalogForm.tsx index 7e8010a8..263b85ed 100644 --- a/src/components/keyboards/editdefinition/catalogform/CatalogForm.tsx +++ b/src/components/keyboards/editdefinition/catalogform/CatalogForm.tsx @@ -79,8 +79,7 @@ export default function CatalogForm(props: CatalogFormProps) { const onChangeKeyboardType = ( event: SelectChangeEvent, - // eslint-disable-next-line no-unused-vars - child: React.ReactNode + _child: React.ReactNode ): void => { props.updateFeature!( event.target.value as IKeyboardFeatures, @@ -90,8 +89,7 @@ export default function CatalogForm(props: CatalogFormProps) { const onChangeKeyLayout = ( event: SelectChangeEvent, - // eslint-disable-next-line no-unused-vars - child: React.ReactNode + _child: React.ReactNode ): void => { props.updateFeature!( event.target.value as IKeyboardFeatures, @@ -192,8 +190,7 @@ export default function CatalogForm(props: CatalogFormProps) { const onChangeHotSwap = ( event: SelectChangeEvent, - // eslint-disable-next-line no-unused-vars - child: React.ReactNode + _child: React.ReactNode ): void => { props.updateFeature!( event.target.value as IKeyboardFeatures, @@ -203,8 +200,7 @@ export default function CatalogForm(props: CatalogFormProps) { const onChangeOled = ( event: SelectChangeEvent, - // eslint-disable-next-line no-unused-vars - child: React.ReactNode + _child: React.ReactNode ): void => { props.updateFeature!( event.target.value as IKeyboardFeatures, @@ -214,8 +210,7 @@ export default function CatalogForm(props: CatalogFormProps) { const onChangeSpeaker = ( event: SelectChangeEvent, - // eslint-disable-next-line no-unused-vars - child: React.ReactNode + _child: React.ReactNode ): void => { props.updateFeature!( event.target.value as IKeyboardFeatures, @@ -225,8 +220,7 @@ export default function CatalogForm(props: CatalogFormProps) { const onChangeWireless = ( event: SelectChangeEvent, - // eslint-disable-next-line no-unused-vars - child: React.ReactNode + _child: React.ReactNode ): void => { props.updateFeature!( event.target.value as IKeyboardFeatures, @@ -285,8 +279,7 @@ export default function CatalogForm(props: CatalogFormProps) { props.updateDescription!(description); }; - // eslint-disable-next-line no-unused-vars - const onClickAddStore = (event: React.MouseEvent) => { + const onClickAddStore = (_event: React.MouseEvent) => { setOpenStoreAddDialog(true); }; @@ -332,8 +325,7 @@ export default function CatalogForm(props: CatalogFormProps) { setAdditionalDescriptionBody(additionalDescription.body); }; - // eslint-disable-next-line no-unused-vars - const onClickAdditionalDescriptionAdd = (event: React.SyntheticEvent) => { + const onClickAdditionalDescriptionAdd = (_event: React.SyntheticEvent) => { props.addAdditionalDescription!( additionalDescriptionTitle, additionalDescriptionBody @@ -801,8 +793,7 @@ export default function CatalogForm(props: CatalogFormProps) { { + onClick={(_event: React.MouseEvent) => { onClickDeleteStore(store); }} > diff --git a/src/components/keyboards/editdefinition/catalogform/StoreAddDialog.tsx b/src/components/keyboards/editdefinition/catalogform/StoreAddDialog.tsx index 21d16faa..427a4310 100644 --- a/src/components/keyboards/editdefinition/catalogform/StoreAddDialog.tsx +++ b/src/components/keyboards/editdefinition/catalogform/StoreAddDialog.tsx @@ -40,7 +40,7 @@ export default class StoreAddDialog extends React.Component< } // eslint-disable-next-line no-unused-vars - private onClickClose(event: React.MouseEvent) { + private onClickClose(_event: React.MouseEvent) { this.props.onClose(); } diff --git a/src/components/organizations/editorganization/EditOrganization.tsx b/src/components/organizations/editorganization/EditOrganization.tsx index 79bee388..e7b9dfda 100644 --- a/src/components/organizations/editorganization/EditOrganization.tsx +++ b/src/components/organizations/editorganization/EditOrganization.tsx @@ -179,7 +179,7 @@ export default class EditOrganization extends React.Component< { + onClick={(_event: React.MouseEvent) => { this.handleDeleteMemberClick(member); }} disabled={member.me} diff --git a/src/components/top/Top.container.ts b/src/components/top/Top.container.ts index 26fbefb4..59080063 100644 --- a/src/components/top/Top.container.ts +++ b/src/components/top/Top.container.ts @@ -4,7 +4,7 @@ import Top from './Top'; import { MetaActions } from '../../actions/meta.action'; // eslint-disable-next-line no-unused-vars -const mapStateToProps = (state: RootState) => { +const mapStateToProps = (_state: RootState) => { return {}; }; export type TopStateType = ReturnType; diff --git a/src/index.tsx b/src/index.tsx index 64af7f45..e16c83d4 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import ReactDOM from 'react-dom'; import './index.scss'; import { createStore, applyMiddleware } from 'redux'; import { Provider } from 'react-redux'; diff --git a/src/services/firmware/Command.ts b/src/services/firmware/Command.ts index 1ed9c0ac..4c84835d 100644 --- a/src/services/firmware/Command.ts +++ b/src/services/firmware/Command.ts @@ -44,7 +44,7 @@ export abstract class AbstractCommand< } // eslint-disable-next-line no-unused-vars - protected async verify(serial: ISerial): Promise { + protected async verify(_serial: ISerial): Promise { return { success: false, error: 'Verification logic not implemented.', diff --git a/src/services/firmware/caterina/CaterinaCommands.ts b/src/services/firmware/caterina/CaterinaCommands.ts index 95b79315..da78a49c 100644 --- a/src/services/firmware/caterina/CaterinaCommands.ts +++ b/src/services/firmware/caterina/CaterinaCommands.ts @@ -234,7 +234,7 @@ export class SetDeviceTypeCommand extends AbstractCaterinaCommand< } // eslint-disable-next-line no-unused-vars - createResponse(resultArray: Uint8Array): ICommandResponse { + createResponse(_resultArray: Uint8Array): ICommandResponse { return {}; } @@ -382,7 +382,7 @@ export class SetAddressCommand extends AbstractCaterinaCommand< } // eslint-disable-next-line no-unused-vars - createResponse(resultArray: Uint8Array): ICommandResponse { + createResponse(_resultArray: Uint8Array): ICommandResponse { return {}; } @@ -404,7 +404,7 @@ export class ExitCommand extends AbstractCaterinaCommand< } // eslint-disable-next-line no-unused-vars - createResponse(resultArray: Uint8Array): ICommandResponse { + createResponse(_resultArray: Uint8Array): ICommandResponse { return {}; } @@ -479,7 +479,7 @@ export class EnterProgramModeCommand extends AbstractCaterinaCommand< } // eslint-disable-next-line no-unused-vars - createResponse(resultArray: Uint8Array): ICommandResponse { + createResponse(_resultArray: Uint8Array): ICommandResponse { return {}; } @@ -501,7 +501,7 @@ export class LeaveProgramModeCommand extends AbstractCaterinaCommand< } // eslint-disable-next-line no-unused-vars - createResponse(resultArray: Uint8Array): ICommandResponse { + createResponse(_resultArray: Uint8Array): ICommandResponse { return {}; } @@ -523,7 +523,7 @@ export class ClearApplicationSectionOfFlashCommand extends AbstractCaterinaComma } // eslint-disable-next-line no-unused-vars - createResponse(resultArray: Uint8Array): ICommandResponse { + createResponse(_resultArray: Uint8Array): ICommandResponse { return {}; } @@ -570,7 +570,7 @@ export class WriteBytesToMemoryCommand extends AbstractCaterinaCommand< } // eslint-disable-next-line no-unused-vars - createResponse(resultArray: Uint8Array): ICommandResponse { + createResponse(_resultArray: Uint8Array): ICommandResponse { return {}; } diff --git a/src/services/firmware/copy/WebFileSystem.ts b/src/services/firmware/copy/WebFileSystem.ts index 41c078d7..ee72de55 100644 --- a/src/services/firmware/copy/WebFileSystem.ts +++ b/src/services/firmware/copy/WebFileSystem.ts @@ -28,31 +28,24 @@ export class WebFileSystem implements IBootloader { } async read( - // eslint-disable-next-line no-unused-vars - size: number, - // eslint-disable-next-line no-unused-vars - progress: FirmwareWriterProgressListener, - // eslint-disable-next-line no-unused-vars - phase: FirmwareWriterPhaseListener + _size: number, + _progress: FirmwareWriterProgressListener, + _phase: FirmwareWriterPhaseListener ): Promise { throw new Error('This method never be called.'); } async verify( - // eslint-disable-next-line no-unused-vars - bytes: Uint8Array, - // eslint-disable-next-line no-unused-vars - progress: FirmwareWriterProgressListener, - // eslint-disable-next-line no-unused-vars - phase: FirmwareWriterPhaseListener + _bytes: Uint8Array, + _progress: FirmwareWriterProgressListener, + _phase: FirmwareWriterPhaseListener ): Promise { throw new Error('This method never be called.'); } async write( flashBytes: Uint8Array, - // eslint-disable-next-line no-unused-vars - eepromBytes: Uint8Array | null, + _eepromBytes: Uint8Array | null, progress: FirmwareWriterProgressListener, phase: FirmwareWriterPhaseListener ): Promise { diff --git a/src/services/firmware/dfu/AtmelDfuBootloader.ts b/src/services/firmware/dfu/AtmelDfuBootloader.ts index 3904fa4f..7f6bbdbd 100644 --- a/src/services/firmware/dfu/AtmelDfuBootloader.ts +++ b/src/services/firmware/dfu/AtmelDfuBootloader.ts @@ -46,12 +46,9 @@ export default class AtmelDfuBootloader extends AbstractDfuBootloader { } async read( - // eslint-disable-next-line no-unused-vars - size: number, - // eslint-disable-next-line no-unused-vars - progress: FirmwareWriterProgressListener, - // eslint-disable-next-line no-unused-vars - phase: FirmwareWriterPhaseListener + _size: number, + _progress: FirmwareWriterProgressListener, + _phase: FirmwareWriterPhaseListener ): Promise { return { success: false, @@ -397,7 +394,7 @@ export default class AtmelDfuBootloader extends AbstractDfuBootloader { dfuGetStatusResult.status!.state === USB_STATE.DFU_DOWNLOAD_BUSY ) { // eslint-disable-next-line no-unused-vars - return new Promise((resolve, reject) => { + return new Promise((resolve, _reject) => { setTimeout(() => { this.waitUntilErasingFinished(start, retries, progress) .then((result) => { diff --git a/src/services/firmware/serial/WebSerial.ts b/src/services/firmware/serial/WebSerial.ts index 51908095..6c0f6e23 100644 --- a/src/services/firmware/serial/WebSerial.ts +++ b/src/services/firmware/serial/WebSerial.ts @@ -23,7 +23,7 @@ export class WebSerial implements ISerial { errorHandler: IErrorHandler ): Promise { // eslint-disable-next-line no-unused-vars - return new Promise((resolve, reject) => { + return new Promise((resolve, _reject) => { this.openPort(baudRate, bufferSize) .then((result) => { if (!result.success) { @@ -201,7 +201,7 @@ export class WebSerial implements ISerial { private async sleep(ms: number): Promise { // eslint-disable-next-line no-unused-vars - return new Promise((resolve, reject) => { + return new Promise((resolve, _reject) => { setTimeout(resolve, ms); }); } diff --git a/src/services/hid/Commands.ts b/src/services/hid/Commands.ts index 174a4bb3..c852e7b3 100644 --- a/src/services/hid/Commands.ts +++ b/src/services/hid/Commands.ts @@ -226,7 +226,7 @@ export class BacklightSaveCommand extends AbstractCommand< } // eslint-disable-next-line no-unused-vars - createResponse(resultArray: Uint8Array): ICommandResponse { + createResponse(_resultArray: Uint8Array): ICommandResponse { return {}; } @@ -313,9 +313,9 @@ export class RgbLightSetValueCommand extends AbstractCommand< const valueId = this.getRequest().valueId; return ( resultArray[0] === id_custom_set_value && - resultArray[1] === id_qmk_rgblight_channel && - resultArray[2] === valueId && - resultArray[3] === this.getRequest().value1, + resultArray[1] === id_qmk_rgblight_channel && + resultArray[2] === valueId && + resultArray[3] === this.getRequest().value1 && resultArray[4] === this.getRequest().value2 ); } @@ -330,7 +330,7 @@ export class RgbLightSaveCommand extends AbstractCommand< } // eslint-disable-next-line no-unused-vars - createResponse(resultArray: Uint8Array): ICommandResponse { + createResponse(_resultArray: Uint8Array): ICommandResponse { return {}; } @@ -523,7 +523,7 @@ export class DynamicKeymapResetCommand extends AbstractCommand< } // eslint-disable-next-line no-unused-vars - createResponse(resultArray: Uint8Array): ICommandResponse { + createResponse(_resultArray: Uint8Array): ICommandResponse { return {}; } @@ -797,7 +797,7 @@ export class SetLayoutOptionsCommand extends AbstractCommand< } // eslint-disable-next-line no-unused-vars - createResponse(resultArray: Uint8Array): ICommandResponse { + createResponse(_resultArray: Uint8Array): ICommandResponse { return {}; } @@ -894,7 +894,7 @@ export class DynamicKeymapSetEncoderCommand extends AbstractCommand< } // eslint-disable-next-line no-unused-vars - createResponse(resultArray: Uint8Array): ICommandResponse { + createResponse(_resultArray: Uint8Array): ICommandResponse { return {}; } diff --git a/src/services/hid/Hid.mock.ts b/src/services/hid/Hid.mock.ts index ad07d10d..193335e4 100644 --- a/src/services/hid/Hid.mock.ts +++ b/src/services/hid/Hid.mock.ts @@ -27,15 +27,15 @@ export const IHidMock: IHid = { resolve([kbd]); }); }, - setConnectionEventHandler: (handler: IConnectionEventHandler) => {}, - connect: (connectParams?: IConnectParams) => { + setConnectionEventHandler: (_handler: IConnectionEventHandler) => {}, + connect: (_connectParams?: IConnectParams) => { return new Promise((resolve) => { const kbd: IKeyboard = {} as IKeyboard; resolve({ success: true, keyboard: kbd }); }); }, close: () => {}, - createKeycodeCompositionFactory: (code: number) => { + createKeycodeCompositionFactory: (_code: number) => { return {} as any; }, }; @@ -58,10 +58,10 @@ export const mockIKeyboad: IKeyboard = { isOpened: () => { return true; }, - isSameDevice: (target) => { + isSameDevice: (_target) => { return true; }, - enqueue: (command: ICommand) => { + enqueue: (_command: ICommand) => { return new Promise((resolve) => { resolve({ success: true }); }); @@ -77,10 +77,10 @@ export const mockIKeyboad: IKeyboard = { }); }, fetchKeymaps: ( - layer: number, - rowCount: number, - columnCount: number, - labelLang: KeyboardLabelLang + _layer: number, + _rowCount: number, + _columnCount: number, + _labelLang: KeyboardLabelLang ) => { return new Promise((resolve) => { resolve({ @@ -107,10 +107,10 @@ export const mockIKeyboad: IKeyboard = { }); }, fetchEncodersKeymaps( - layer: number, - encoderIds: number[], - labelLang: KeyboardLabelLang, - customKeycodes: ICustomKeycode[] | undefined + _layer: number, + _encoderIds: number[], + _labelLang: KeyboardLabelLang, + _customKeycodes: ICustomKeycode[] | undefined ): Promise { return new Promise((resolve) => { resolve({ @@ -154,16 +154,21 @@ export const mockIKeyboad: IKeyboard = { }); }); }, - updateKeymap: (ayer: number, row: number, column: number, code: number) => { + updateKeymap: ( + _layer: number, + _row: number, + _column: number, + _code: number + ) => { return new Promise((resolve) => { resolve({ success: true }); }); }, updateEncoderKeymap( - layer: number, - encoderId: number, - clockwise: boolean, - code: number + _layer: number, + _encoderId: number, + _clockwise: boolean, + _code: number ): Promise { return new Promise((resolve) => { resolve({ success: true }); @@ -199,32 +204,32 @@ export const mockIKeyboad: IKeyboard = { resolve({ success: true, hue: 200, sat: 111 }); }); }, - updateBacklightBrightness: (brightness: number) => { + updateBacklightBrightness: (_brightness: number) => { return new Promise((resolve) => { resolve({ success: true }); }); }, - updateBacklightEffect: (isBreathing: boolean) => { + updateBacklightEffect: (_isBreathing: boolean) => { return new Promise((resolve) => { resolve({ success: true }); }); }, - updateRGBLightBrightness: (brightness: number) => { + updateRGBLightBrightness: (_brightness: number) => { return new Promise((resolve) => { resolve({ success: true }); }); }, - updateRGBLightEffect: (mode: number) => { + updateRGBLightEffect: (_mode: number) => { return new Promise((resolve) => { resolve({ success: true }); }); }, - updateRGBLightEffectSpeed: (speed: number) => { + updateRGBLightEffectSpeed: (_speed: number) => { return new Promise((resolve) => { resolve({ success: true }); }); }, - updateRGBLightColor: (hue: number, sat: number) => { + updateRGBLightColor: (_hue: number, _sat: number) => { return new Promise((resolve) => { resolve({ success: true }); }); @@ -249,7 +254,7 @@ export const mockIKeyboad: IKeyboard = { resolve({ success: true, value: 0 }); }); }, - updateLayoutOptions: (value: number) => { + updateLayoutOptions: (_value: number) => { return new Promise((resolve) => { resolve({ success: true }); }); @@ -264,12 +269,12 @@ export const mockIKeyboad: IKeyboard = { resolve({ success: true, bufferSize: 0 }); }); }, - fetchMacroBuffer: (bufferSize: number) => { + fetchMacroBuffer: (_bufferSize: number) => { return new Promise((resolve) => { resolve({ success: true, buffer: new Uint8Array(0) }); }); }, - updateMacroBuffer: (offset: number, buffer: Uint8Array) => { + updateMacroBuffer: (_offset: number, _buffer: Uint8Array) => { return new Promise((resolve) => { resolve({ success: true }); }); diff --git a/src/services/provider/Firebase.test.ts b/src/services/provider/Firebase.test.ts index 8a612406..3eb8e877 100644 --- a/src/services/provider/Firebase.test.ts +++ b/src/services/provider/Firebase.test.ts @@ -1,6 +1,5 @@ import { FirebaseProvider } from './Firebase'; import firebase from 'firebase/app'; -import * as sinon from 'sinon'; describe('FirebaseProvider', () => { test('createFirmwareFilename', () => { diff --git a/src/services/provider/Firebase.ts b/src/services/provider/Firebase.ts index 33e030e8..283e7d11 100644 --- a/src/services/provider/Firebase.ts +++ b/src/services/provider/Firebase.ts @@ -1037,7 +1037,7 @@ export class FirebaseProvider implements IStorage, IAuth { progress?: (uploadedRate: number) => void ): Promise { // eslint-disable-next-line no-unused-vars - return new Promise((resolve, reject) => { + return new Promise((resolve, _reject) => { const filename = FirebaseProvider.createFirmwareFilename( keyboardName, firmwareFile, @@ -1248,7 +1248,7 @@ export class FirebaseProvider implements IStorage, IAuth { progress: (uploadedRate: number) => void ): Promise { // eslint-disable-next-line no-unused-vars - return new Promise((resolve, reject) => { + return new Promise((resolve, _reject) => { const uploadTask = this.storage.ref(`/catalog/${definitionId}`).put(file); uploadTask.on( firebase.storage.TaskEvent.STATE_CHANGED, @@ -1292,7 +1292,7 @@ export class FirebaseProvider implements IStorage, IAuth { progress: (uploadedRate: number) => void ): Promise { // eslint-disable-next-line no-unused-vars - return new Promise((resolve, reject) => { + return new Promise((resolve, _reject) => { const timestamp = new Date().getTime(); const uploadTask = this.storage .ref(`/catalog/${definitionId}_${timestamp}`) diff --git a/yarn.lock b/yarn.lock index d4b836c5..443a64a9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2065,7 +2065,7 @@ __metadata: languageName: node linkType: hard -"@eslint-community/eslint-utils@npm:^4.2.0": +"@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0": version: 4.4.0 resolution: "@eslint-community/eslint-utils@npm:4.4.0" dependencies: @@ -2076,6 +2076,13 @@ __metadata: languageName: node linkType: hard +"@eslint-community/regexpp@npm:^4.10.0": + version: 4.10.1 + resolution: "@eslint-community/regexpp@npm:4.10.1" + checksum: 10c0/f59376025d0c91dd9fdf18d33941df499292a3ecba3e9889c360f3f6590197d30755604588786cdca0f9030be315a26b206014af4b65c0ff85b4ec49043de780 + languageName: node + linkType: hard + "@eslint-community/regexpp@npm:^4.6.1": version: 4.10.0 resolution: "@eslint-community/regexpp@npm:4.10.0" @@ -4985,7 +4992,7 @@ __metadata: languageName: node linkType: hard -"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.4, @types/json-schema@npm:^7.0.5, @types/json-schema@npm:^7.0.6, @types/json-schema@npm:^7.0.7, @types/json-schema@npm:^7.0.8, @types/json-schema@npm:^7.0.9": +"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.4, @types/json-schema@npm:^7.0.5, @types/json-schema@npm:^7.0.6, @types/json-schema@npm:^7.0.8, @types/json-schema@npm:^7.0.9": version: 7.0.15 resolution: "@types/json-schema@npm:7.0.15" checksum: 10c0/a996a745e6c5d60292f36731dd41341339d4eeed8180bb09226e5c8d23759067692b1d88e5d91d72ee83dfc00d3aca8e7bd43ea120516c17922cbcb7c3e252db @@ -5300,41 +5307,26 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^4.10.0": - version: 4.33.0 - resolution: "@typescript-eslint/eslint-plugin@npm:4.33.0" +"@typescript-eslint/eslint-plugin@npm:^7.13.0": + version: 7.13.0 + resolution: "@typescript-eslint/eslint-plugin@npm:7.13.0" dependencies: - "@typescript-eslint/experimental-utils": "npm:4.33.0" - "@typescript-eslint/scope-manager": "npm:4.33.0" - debug: "npm:^4.3.1" - functional-red-black-tree: "npm:^1.0.1" - ignore: "npm:^5.1.8" - regexpp: "npm:^3.1.0" - semver: "npm:^7.3.5" - tsutils: "npm:^3.21.0" + "@eslint-community/regexpp": "npm:^4.10.0" + "@typescript-eslint/scope-manager": "npm:7.13.0" + "@typescript-eslint/type-utils": "npm:7.13.0" + "@typescript-eslint/utils": "npm:7.13.0" + "@typescript-eslint/visitor-keys": "npm:7.13.0" + graphemer: "npm:^1.4.0" + ignore: "npm:^5.3.1" + natural-compare: "npm:^1.4.0" + ts-api-utils: "npm:^1.3.0" peerDependencies: - "@typescript-eslint/parser": ^4.0.0 - eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 + "@typescript-eslint/parser": ^7.0.0 + eslint: ^8.56.0 peerDependenciesMeta: typescript: optional: true - checksum: 10c0/c1e1e424e257fa6e5e8b18d7ff77e8a983a761f4acc0cd58ebd31de8ec56c8c472689989cff0290eee41457662a1e664b555cf74bfc1b37bdf8c87ccac2a4663 - languageName: node - linkType: hard - -"@typescript-eslint/experimental-utils@npm:4.33.0": - version: 4.33.0 - resolution: "@typescript-eslint/experimental-utils@npm:4.33.0" - dependencies: - "@types/json-schema": "npm:^7.0.7" - "@typescript-eslint/scope-manager": "npm:4.33.0" - "@typescript-eslint/types": "npm:4.33.0" - "@typescript-eslint/typescript-estree": "npm:4.33.0" - eslint-scope: "npm:^5.1.1" - eslint-utils: "npm:^3.0.0" - peerDependencies: - eslint: "*" - checksum: 10c0/bb2a48c9df21ef06ccbcd083753b8c51b30a46cde67ab56d278b30ad7868d2e07641e51b6f7fb54437dcb7aff134fac44708e730e2b8f6e43027fefe8629bcb9 + checksum: 10c0/00a69d029713252c03490e0a9c49c9136d99c9c1888dd3570b1e044c9a740b59c2e488849beda654d6fc0a69e2549445c16d443bcf5832c66b7a4472b42826ae languageName: node linkType: hard @@ -5356,16 +5348,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:4.33.0": - version: 4.33.0 - resolution: "@typescript-eslint/scope-manager@npm:4.33.0" - dependencies: - "@typescript-eslint/types": "npm:4.33.0" - "@typescript-eslint/visitor-keys": "npm:4.33.0" - checksum: 10c0/1dfe65777eeb430c1ef778bdad35e6065d4b3075ddb2639d0747d8db93c02eebf6832ba82388a7f80662e0e9f61f1922fe939b53a20889e11fb9f80c4029c6b7 - languageName: node - linkType: hard - "@typescript-eslint/scope-manager@npm:7.11.0": version: 7.11.0 resolution: "@typescript-eslint/scope-manager@npm:7.11.0" @@ -5376,10 +5358,30 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/types@npm:4.33.0": - version: 4.33.0 - resolution: "@typescript-eslint/types@npm:4.33.0" - checksum: 10c0/6c94780a589eca7a75ae2b014f320bc412b50794c39ab04889918bb39a40e72584b65c8c0b035330cb0599579afaa3adccee40701f63cf39c0e89299de199d4b +"@typescript-eslint/scope-manager@npm:7.13.0": + version: 7.13.0 + resolution: "@typescript-eslint/scope-manager@npm:7.13.0" + dependencies: + "@typescript-eslint/types": "npm:7.13.0" + "@typescript-eslint/visitor-keys": "npm:7.13.0" + checksum: 10c0/0f5c75578ee8cb3c31b9c4e222f4787ea4621fde639f3ac0a467e56250f3cc48bf69304c33b2b8cc8ba5ec69f3977b6c463b8d9e791806af9a8c6a2233505432 + languageName: node + linkType: hard + +"@typescript-eslint/type-utils@npm:7.13.0": + version: 7.13.0 + resolution: "@typescript-eslint/type-utils@npm:7.13.0" + dependencies: + "@typescript-eslint/typescript-estree": "npm:7.13.0" + "@typescript-eslint/utils": "npm:7.13.0" + debug: "npm:^4.3.4" + ts-api-utils: "npm:^1.3.0" + peerDependencies: + eslint: ^8.56.0 + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/240e9b34e8602444cd234b84c9e3e52c565e3141a4942751f597c38cee48f7cb43c42a093d219ac6404dca2e74b54d2a8121fe66cbc59f404cb0ec2adecd8520 languageName: node linkType: hard @@ -5390,21 +5392,10 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:4.33.0": - version: 4.33.0 - resolution: "@typescript-eslint/typescript-estree@npm:4.33.0" - dependencies: - "@typescript-eslint/types": "npm:4.33.0" - "@typescript-eslint/visitor-keys": "npm:4.33.0" - debug: "npm:^4.3.1" - globby: "npm:^11.0.3" - is-glob: "npm:^4.0.1" - semver: "npm:^7.3.5" - tsutils: "npm:^3.21.0" - peerDependenciesMeta: - typescript: - optional: true - checksum: 10c0/67609a7bdd680136765d103dec4b8afb38a17436e8a5cd830da84f62c6153c3acba561da3b9e2140137b1a0bcbbfc19d4256c692f7072acfebcff88db079e22b +"@typescript-eslint/types@npm:7.13.0": + version: 7.13.0 + resolution: "@typescript-eslint/types@npm:7.13.0" + checksum: 10c0/73dc59d4b0d0f0fed9f4b9b55f143185259ced5f0ca8ad9efa881eea1ff1cc9ccc1f175af2e2069f7b92a69c9f64f9be29d160c932b8f70a129af6b738b23be0 languageName: node linkType: hard @@ -5427,13 +5418,36 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:4.33.0": - version: 4.33.0 - resolution: "@typescript-eslint/visitor-keys@npm:4.33.0" +"@typescript-eslint/typescript-estree@npm:7.13.0": + version: 7.13.0 + resolution: "@typescript-eslint/typescript-estree@npm:7.13.0" dependencies: - "@typescript-eslint/types": "npm:4.33.0" - eslint-visitor-keys: "npm:^2.0.0" - checksum: 10c0/95b3904db6113ef365892567d47365e6af3708e6fa905743426036f99e1b7fd4a275facec5d939afecb618369f9d615e379d39f96b8936f469e75507c41c249c + "@typescript-eslint/types": "npm:7.13.0" + "@typescript-eslint/visitor-keys": "npm:7.13.0" + debug: "npm:^4.3.4" + globby: "npm:^11.1.0" + is-glob: "npm:^4.0.3" + minimatch: "npm:^9.0.4" + semver: "npm:^7.6.0" + ts-api-utils: "npm:^1.3.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/75b09384bc14afa3d3623507432d19d8ca91c4e936b1d2c1cfe4654a9c07179f1bc04aa99d1b541e84e40a01536862b23058f462d61b4a797c27d02f64b8aa51 + languageName: node + linkType: hard + +"@typescript-eslint/utils@npm:7.13.0": + version: 7.13.0 + resolution: "@typescript-eslint/utils@npm:7.13.0" + dependencies: + "@eslint-community/eslint-utils": "npm:^4.4.0" + "@typescript-eslint/scope-manager": "npm:7.13.0" + "@typescript-eslint/types": "npm:7.13.0" + "@typescript-eslint/typescript-estree": "npm:7.13.0" + peerDependencies: + eslint: ^8.56.0 + checksum: 10c0/5391f628775dec1a7033d954a066b77eeb03ac04c0a94690e60d8ebe351b57fdbda51b90cf785c901bcdf68b88ca3bcb5533ac59276b8b626b73eb18ac3280b6 languageName: node linkType: hard @@ -5447,6 +5461,16 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/visitor-keys@npm:7.13.0": + version: 7.13.0 + resolution: "@typescript-eslint/visitor-keys@npm:7.13.0" + dependencies: + "@typescript-eslint/types": "npm:7.13.0" + eslint-visitor-keys: "npm:^3.4.3" + checksum: 10c0/5daa45c3358aeab41495c4419cc26fbbe54a42bb18c6f0f70f0ac31cb7bc5890ec6478a1a6bb00b0b8522663fe5466ee0fd2972bd4235b07140918875797f4eb + languageName: node + linkType: hard + "@ungap/structured-clone@npm:^1.2.0": version: 1.2.0 resolution: "@ungap/structured-clone@npm:1.2.0" @@ -5901,7 +5925,7 @@ __metadata: "@types/w3c-web-serial": "npm:^1.0.2" "@types/w3c-web-usb": "npm:^1.0.5" "@types/wicg-file-system-access": "npm:^2020.9.7" - "@typescript-eslint/eslint-plugin": "npm:^4.10.0" + "@typescript-eslint/eslint-plugin": "npm:^7.13.0" "@typescript-eslint/parser": "npm:^7.11.0" "@vitejs/plugin-react-swc": "npm:^3.7.0" ajv: "npm:^7.0.3" @@ -9281,7 +9305,7 @@ __metadata: languageName: node linkType: hard -"eslint-scope@npm:5.1.1, eslint-scope@npm:^5.1.1": +"eslint-scope@npm:5.1.1": version: 5.1.1 resolution: "eslint-scope@npm:5.1.1" dependencies: @@ -9311,17 +9335,6 @@ __metadata: languageName: node linkType: hard -"eslint-utils@npm:^3.0.0": - version: 3.0.0 - resolution: "eslint-utils@npm:3.0.0" - dependencies: - eslint-visitor-keys: "npm:^2.0.0" - peerDependencies: - eslint: ">=5" - checksum: 10c0/45aa2b63667a8d9b474c98c28af908d0a592bed1a4568f3145cd49fb5d9510f545327ec95561625290313fe126e6d7bdfe3fdbdb6f432689fab6b9497d3bfb52 - languageName: node - linkType: hard - "eslint-visitor-keys@npm:^1.0.0": version: 1.3.0 resolution: "eslint-visitor-keys@npm:1.3.0" @@ -9329,13 +9342,6 @@ __metadata: languageName: node linkType: hard -"eslint-visitor-keys@npm:^2.0.0": - version: 2.1.0 - resolution: "eslint-visitor-keys@npm:2.1.0" - checksum: 10c0/9f0e3a2db751d84067d15977ac4b4472efd6b303e369e6ff241a99feac04da758f46d5add022c33d06b53596038dbae4b4aceb27c7e68b8dfc1055b35e495787 - languageName: node - linkType: hard - "eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.3": version: 3.4.3 resolution: "eslint-visitor-keys@npm:3.4.3" @@ -10295,13 +10301,6 @@ __metadata: languageName: node linkType: hard -"functional-red-black-tree@npm:^1.0.1": - version: 1.0.1 - resolution: "functional-red-black-tree@npm:1.0.1" - checksum: 10c0/5959eed0375803d9924f47688479bb017e0c6816a0e5ac151e22ba6bfe1d12c41de2f339188885e0aa8eeea2072dad509d8e4448467e816bde0a2ca86a0670d3 - languageName: node - linkType: hard - "functions-have-names@npm:^1.2.3": version: 1.2.3 resolution: "functions-have-names@npm:1.2.3" @@ -10577,7 +10576,7 @@ __metadata: languageName: node linkType: hard -"globby@npm:^11.0.2, globby@npm:^11.0.3, globby@npm:^11.1.0": +"globby@npm:^11.0.2, globby@npm:^11.1.0": version: 11.1.0 resolution: "globby@npm:11.1.0" dependencies: @@ -11164,7 +11163,7 @@ __metadata: languageName: node linkType: hard -"ignore@npm:^5.1.8, ignore@npm:^5.2.0": +"ignore@npm:^5.2.0, ignore@npm:^5.3.1": version: 5.3.1 resolution: "ignore@npm:5.3.1" checksum: 10c0/703f7f45ffb2a27fb2c5a8db0c32e7dee66b33a225d28e8db4e1be6474795f606686a6e3bcc50e1aa12f2042db4c9d4a7d60af3250511de74620fbed052ea4cd @@ -15573,13 +15572,6 @@ __metadata: languageName: node linkType: hard -"regexpp@npm:^3.1.0": - version: 3.2.0 - resolution: "regexpp@npm:3.2.0" - checksum: 10c0/d1da82385c8754a1681416b90b9cca0e21b4a2babef159099b88f640637d789c69011d0bc94705dacab85b81133e929d027d85210e8b8b03f8035164dbc14710 - languageName: node - linkType: hard - "regexpu-core@npm:^5.3.1": version: 5.3.2 resolution: "regexpu-core@npm:5.3.2" @@ -17509,7 +17501,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^1.11.1, tslib@npm:^1.8.1": +"tslib@npm:^1.11.1": version: 1.14.1 resolution: "tslib@npm:1.14.1" checksum: 10c0/69ae09c49eea644bc5ebe1bca4fa4cc2c82b7b3e02f43b84bd891504edf66dbc6b2ec0eef31a957042de2269139e4acff911e6d186a258fb14069cd7f6febce2 @@ -17541,17 +17533,6 @@ __metadata: languageName: node linkType: hard -"tsutils@npm:^3.21.0": - version: 3.21.0 - resolution: "tsutils@npm:3.21.0" - dependencies: - tslib: "npm:^1.8.1" - peerDependencies: - typescript: ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - checksum: 10c0/02f19e458ec78ead8fffbf711f834ad8ecd2cc6ade4ec0320790713dccc0a412b99e7fd907c4cda2a1dc602c75db6f12e0108e87a5afad4b2f9e90a24cabd5a2 - languageName: node - linkType: hard - "tty-browserify@npm:0.0.0": version: 0.0.0 resolution: "tty-browserify@npm:0.0.0"