From ec2464d3e338bee590786efa5f706ecfad51e86a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Souchet=20C=C3=A9line?= Date: Tue, 29 Aug 2023 13:59:26 +0200 Subject: [PATCH] fix: Use `.key` instead of `.which` unicorn/prefer-keyboard-event-key --- dev/ts/shared/controls.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dev/ts/shared/controls.ts b/dev/ts/shared/controls.ts index bcdb274044..f0abcf4c9a 100644 --- a/dev/ts/shared/controls.ts +++ b/dev/ts/shared/controls.ts @@ -71,7 +71,8 @@ function showMousePointer(): void { 'mousedown', event => { updateButtons(event.buttons); - box.classList.add('button-' + event.which); + // eslint-disable-next-line unicorn/prefer-keyboard-event-key -- 'key' doesn't exist + box.classList.add(`button-${event.which}`); }, true, ); @@ -79,7 +80,8 @@ function showMousePointer(): void { 'mouseup', event => { updateButtons(event.buttons); - box.classList.remove('button-' + event.which); + // eslint-disable-next-line unicorn/prefer-keyboard-event-key -- 'key' doesn't exist + box.classList.remove(`button-${event.which}`); }, true, );