From 62fb4caf3f1925751dab42fe029e69252a366ee4 Mon Sep 17 00:00:00 2001 From: silverwind Date: Tue, 28 Oct 2025 18:26:45 +0100 Subject: [PATCH] Enable `vue/require-typed-ref` eslint rule --- eslint.config.ts | 1 + web_src/js/components/ContextPopup.vue | 9 +++++---- web_src/js/types.ts | 16 +++++++++++----- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/eslint.config.ts b/eslint.config.ts index d9c4bcae3a..2a9684933f 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -921,6 +921,7 @@ export default defineConfig([ 'vue/html-closing-bracket-spacing': [2, {startTag: 'never', endTag: 'never', selfClosingTag: 'never'}], 'vue/max-attributes-per-line': [0], 'vue/singleline-html-element-content-newline': [0], + 'vue/require-typed-ref': [2], }, }, { diff --git a/web_src/js/components/ContextPopup.vue b/web_src/js/components/ContextPopup.vue index aebfaa5d26..3e1ff305c6 100644 --- a/web_src/js/components/ContextPopup.vue +++ b/web_src/js/components/ContextPopup.vue @@ -3,16 +3,17 @@ import {SvgIcon} from '../svg.ts'; import {GET} from '../modules/fetch.ts'; import {getIssueColor, getIssueIcon} from '../features/issue.ts'; import {computed, onMounted, shallowRef} from 'vue'; +import type {Issue} from '../types.ts'; const props = defineProps<{ repoLink: string, loadIssueInfoUrl: string, }>(); -const loading = shallowRef(false); -const issue = shallowRef(null); -const renderedLabels = shallowRef(''); -const errorMessage = shallowRef(null); +const loading = shallowRef(false); +const issue = shallowRef(null); +const renderedLabels = shallowRef(''); +const errorMessage = shallowRef(null); const createdAt = computed(() => { return new Date(issue.value.created_at).toLocaleDateString(undefined, {year: 'numeric', month: 'short', day: 'numeric'}); diff --git a/web_src/js/types.ts b/web_src/js/types.ts index 56d6c56d13..31f41766e7 100644 --- a/web_src/js/types.ts +++ b/web_src/js/types.ts @@ -52,14 +52,20 @@ export type IssuePageInfo = { }; export type Issue = { - id: number; - number: number; - title: string; - state: 'open' | 'closed'; + id: number, + number: number, + title: string, + body: string, + state: 'open' | 'closed', + created_at: string, pull_request?: { draft: boolean; merged: boolean; - }; + }, + repository: { + full_name: string, + }, + labels: Array, }; export type FomanticInitFunction = {