From c1cf9032f7dd95bcf06580489accbb707b9ebc97 Mon Sep 17 00:00:00 2001 From: conor Date: Sat, 3 Feb 2024 23:36:04 -0800 Subject: [PATCH] * add some linting rules * minor linting fixes * add file extensions --- client/.eslintrc.cjs | 20 ++++++++++++++----- client/src/components/endRound/EndRound.vue | 8 ++++---- .../src/components/endRound/PlayerChooser.vue | 4 ++-- client/src/components/gameShared/Prompt.vue | 1 + .../components/gameShared/ResponseList.vue | 8 ++++---- .../components/gameShared/SelectionType.vue | 6 +++--- client/src/components/gameShared/Timer.vue | 9 ++++----- .../components/gameShared/VolumeControl.vue | 2 +- client/src/components/lobby/Lobby.vue | 6 +++--- client/src/components/lobby/Options.vue | 9 ++++----- client/src/components/lobby/PlayerCard.vue | 2 +- client/src/components/lobby/PlayerList.vue | 6 +++--- .../promptResponse/PromptResponse.vue | 4 ++-- .../components/promptResponse/VoteSkip.vue | 2 +- .../components/responseMatching/MatchCard.vue | 6 +++--- client/src/views/About.vue | 2 +- client/src/views/Game.vue | 15 +++++++------- client/src/views/Home.vue | 4 ++-- client/src/views/HowToPlay.vue | 2 +- tsconfig.options.json | 1 + 20 files changed, 63 insertions(+), 54 deletions(-) diff --git a/client/.eslintrc.cjs b/client/.eslintrc.cjs index 3657cd8..11b0154 100644 --- a/client/.eslintrc.cjs +++ b/client/.eslintrc.cjs @@ -20,11 +20,21 @@ module.exports = { parser: '@typescript-eslint/parser' }, rules: { - '@typescript-eslint/consistent-type-imports': ['error'], - '@typescript-eslint/unbound-method': ['off'], - '@typescript-eslint/no-unused-vars': ['off'], - '@typescript-eslint/no-unsafe-assignment': ['off'], - 'vue/multi-word-component-names': ['off'], + '@typescript-eslint/consistent-type-imports': 2, + '@typescript-eslint/unbound-method': 0, + '@typescript-eslint/no-unused-vars': 0, + '@typescript-eslint/no-unsafe-assignment': 0, + 'vue/multi-word-component-names': 0, + 'vue/require-typed-ref': 2, + 'vue/component-api-style': [2, ['script-setup']], + 'vue/block-lang': [2, { script: { lang: 'ts' } }], + 'vue/define-macros-order': 2, + // 'vue/define-props-declaration': 2, + 'vue/no-ref-object-reactivity-loss': 2, + 'vue/no-undef-properties': 2, + 'vue/no-unused-components': [2, { ignoreWhenBindingPresent: true }], + 'vue/no-unused-properties': 2, + 'vue/no-unused-refs': 2, 'prettier/prettier': 2 }, ignorePatterns: ['/*', '!/src'] diff --git a/client/src/components/endRound/EndRound.vue b/client/src/components/endRound/EndRound.vue index f768edb..8ae3210 100644 --- a/client/src/components/endRound/EndRound.vue +++ b/client/src/components/endRound/EndRound.vue @@ -1,14 +1,14 @@ diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index ef155ec..82add13 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -9,25 +9,24 @@ import EndRound from '@/components/endRound/EndRound.vue'; import EndGame from '@/components/endGame/EndGame.vue'; import VolumeControl from '@/components/gameShared/VolumeControl.vue'; import TooltipToggle from '@/components/gameShared/TooltipToggle.vue'; -import { useRoomStore } from '@/stores/room'; -import { useGameStore } from '@/stores/game'; +import { useRoomStore } from '@/stores/room.js'; +import { useGameStore } from '@/stores/game.js'; import { Portal } from 'portal-vue'; import { computed, onMounted } from 'vue'; import { useRouter } from 'vue-router'; import { useI18n } from 'vue-i18n'; -const gameStore = useGameStore(); -const roomStore = useRoomStore(); -const router = useRouter(); - -const { t } = useI18n(); - const props = defineProps({ roomName: { type: String, required: true } }); +const gameStore = useGameStore(); +const roomStore = useRoomStore(); +const router = useRouter(); + +const { t } = useI18n(); const gameScenes = { Lobby, diff --git a/client/src/views/Home.vue b/client/src/views/Home.vue index a7a569f..c42347d 100644 --- a/client/src/views/Home.vue +++ b/client/src/views/Home.vue @@ -2,11 +2,11 @@ import { Instance } from '@popperjs/core'; import { onMounted, reactive, type Ref, ref } from 'vue'; import ClickMp3 from '@/assets/audio/click2.mp3'; -import { AudioWrap } from '@/mixins/audiowrap'; +import { AudioWrap } from '@/mixins/audiowrap.js'; import { useGameStore } from '@/stores/game.js'; import { useRoomStore } from '@/stores/room.js'; import { useRoute } from 'vue-router'; -import socket from '@/socket/socket'; +import socket from '@/socket/socket.js'; import { useI18n } from 'vue-i18n'; const click = new AudioWrap(ClickMp3); diff --git a/client/src/views/HowToPlay.vue b/client/src/views/HowToPlay.vue index 8db4a71..5db0912 100644 --- a/client/src/views/HowToPlay.vue +++ b/client/src/views/HowToPlay.vue @@ -5,7 +5,7 @@ import Sike from '@/assets/images/howToPlay/sike.png'; import Choice from '@/assets/images/howToPlay/choice.png'; import Matching from '@/assets/images/howToPlay/matching.png'; import ClickMp3 from '@/assets/audio/click1.mp3'; -import { AudioWrap } from '@/mixins/audiowrap'; +import { AudioWrap } from '@/mixins/audiowrap.js'; import { useI18n } from 'vue-i18n'; const click = new AudioWrap(ClickMp3); diff --git a/tsconfig.options.json b/tsconfig.options.json index d0caefc..1bd7a82 100644 --- a/tsconfig.options.json +++ b/tsconfig.options.json @@ -17,6 +17,7 @@ "moduleResolution": "node", "noEmitOnError": false, "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, "noImplicitOverride": true, "noImplicitReturns": true, "noUnusedLocals": true,