diff --git a/.eslintrc.json b/.eslintrc.json index aa05915..c8ad44c 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,3 +1,13 @@ { - "extends": ["next/core-web-vitals", "plugin:tailwindcss/recommended"] + "extends": [ + "next/core-web-vitals", + "plugin:tailwindcss/recommended", + "plugin:@typescript-eslint/strict-type-checked" + ], + "parser": "@typescript-eslint/parser", + "plugins": ["@typescript-eslint"], + "parserOptions": { + "project": true + }, + "root": true } diff --git a/src/hooks/useGamepad.ts b/src/hooks/useGamepad.ts index 24d4c7e..f594d09 100644 --- a/src/hooks/useGamepad.ts +++ b/src/hooks/useGamepad.ts @@ -62,7 +62,8 @@ const useGamepad = () => { lastClickedRef.current['moveToBottom'] = now + 850 } } - } else if (buttons[0]?.pressed && gamestateRef.current === 'gameover') { + } + if (gamestateRef.current === 'gameover' && buttons[0]?.pressed === true) { // A dispatch(startNewGame()) }