From c3517188a64ada4843e392f26ffc3ec373b6af41 Mon Sep 17 00:00:00 2001 From: tommy Date: Wed, 11 Mar 2026 04:49:00 -0400 Subject: [PATCH 1/2] Fix project type-check errors --- eslint.config.ts | 17 ++++++++++++----- src/api/offstylesApi.ts | 26 ++++++++++++++++++++------ src/components/ComboBox.vue | 21 +++++++++++++-------- src/components/PlayerProfile.vue | 6 +++--- src/types/moderation.ts | 18 ++++++++++++++++++ 5 files changed, 66 insertions(+), 22 deletions(-) diff --git a/eslint.config.ts b/eslint.config.ts index edb1bbb..ff66922 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -1,4 +1,3 @@ -import { globalIgnores } from 'eslint/config' import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript' import pluginVue from 'eslint-plugin-vue' @@ -7,14 +6,22 @@ import pluginVue from 'eslint-plugin-vue' // configureVueProject({ scriptLangs: ['ts', 'tsx'] }) // More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup +const vueEssentialConfig = + pluginVue.configs['flat/essential'] as unknown as Parameters[number] + +const vueTsRecommendedConfig = + vueTsConfigs.recommended as unknown as Parameters[number] + export default defineConfigWithVueTs( { name: 'app/files-to-lint', files: ['**/*.{ts,mts,tsx,vue}'], }, + { + name: 'app/ignores', + ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'], + }, - globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']), - - pluginVue.configs['flat/essential'], - vueTsConfigs.recommended, + vueEssentialConfig, + vueTsRecommendedConfig, ) diff --git a/src/api/offstylesApi.ts b/src/api/offstylesApi.ts index 89a9de1..41a91df 100644 --- a/src/api/offstylesApi.ts +++ b/src/api/offstylesApi.ts @@ -1,8 +1,8 @@ -import { Style } from "@/types/Style"; -import Api from "./api"; -import type { Time } from "@/types/Time"; -import type { User } from "@/types/User"; -import type { RecentModAction, ModerationTargetFilter } from "@/types/moderation"; +import { Style } from '@/types/Style'; +import Api from './api'; +import type { Time } from '@/types/Time'; +import type { User } from '@/types/User'; +import type { RecentModAction, ModerationTargetFilter, ModerationAction } from '@/types/moderation'; // Add new interfaces based on the API spec export interface RankAwareRecord extends Time { @@ -72,6 +72,20 @@ export interface ServerKeyInfo { permissions: number; } +export interface ModerationLogModerator { + steam_id: string; + username: string; + avatar_url?: string; +} + +export interface ModerationLogAction extends ModerationAction { + mod: ModerationLogModerator; +} + +export interface ModerationLogResponse { + actions: ModerationLogAction[]; +} + class OffstylesApi extends Api { static offstylesApiUrl = import.meta.env.DEV ? "/api" : "https://offstyles.tommyy.dev/api"; @@ -318,7 +332,7 @@ class OffstylesApi extends Api { } // Get moderation logs - static async getModerationLogs(id: string): Promise { + static async getModerationLogs(id: string): Promise { const params = new URLSearchParams({ id: id, }); diff --git a/src/components/ComboBox.vue b/src/components/ComboBox.vue index bfe8662..6afbb39 100644 --- a/src/components/ComboBox.vue +++ b/src/components/ComboBox.vue @@ -12,25 +12,30 @@ import IconChevronDown from '@/components/icons/IconChevronDown.vue'; import loadWheel from '@/components/icons/loadWheel.vue'; + interface ComboBoxOptionItem { + id?: number | string, + name: string, + } + const props = defineProps<{ - select_options: object[], - selected_option: { id?:number, name?:string }, + select_options: ComboBoxOptionItem[], + selected_option: ComboBoxOptionItem | null, type: string, is_loading?: boolean, }>() - const selected = ref(props.selected_option); + const selected = ref(props.selected_option); //update selected when parent selected_option changes - const selectedProp = computed(()=>{return props.selected_option}); - watch(selectedProp, async()=>{ - if(props.selected_option !== selected.value){ + const selectedProp = computed(() => props.selected_option); + watch(selectedProp, async () => { + if (props.selected_option !== selected.value) { selected.value = props.selected_option; } }); const emit = defineEmits(['select-Changed']); - watch(selected, async() => { + watch(selected, async () => { emit('select-Changed', selected.value !== null ? selected.value : {}); }); @@ -55,7 +60,7 @@ diff --git a/src/components/PlayerProfile.vue b/src/components/PlayerProfile.vue index d74c36f..7c4280c 100644 --- a/src/components/PlayerProfile.vue +++ b/src/components/PlayerProfile.vue @@ -2,8 +2,8 @@
@@ -11,7 +11,7 @@