0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-11-06 05:50:35 +01:00

Enable vue/require-typed-ref eslint rule (#35764)

Enable https://eslint.vuejs.org/rules/require-typed-ref 
and fix discovered issues.
This commit is contained in:
silverwind 2025-10-29 10:42:06 +01:00 committed by GitHub
parent 95b18eb781
commit fe25997157
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 8 deletions

View File

@ -924,6 +924,7 @@ export default defineConfig([
'vue/html-closing-bracket-spacing': [2, {startTag: 'never', endTag: 'never', selfClosingTag: 'never'}], 'vue/html-closing-bracket-spacing': [2, {startTag: 'never', endTag: 'never', selfClosingTag: 'never'}],
'vue/max-attributes-per-line': [0], 'vue/max-attributes-per-line': [0],
'vue/singleline-html-element-content-newline': [0], 'vue/singleline-html-element-content-newline': [0],
'vue/require-typed-ref': [2],
}, },
}, },
{ {

View File

@ -3,6 +3,7 @@ import {SvgIcon} from '../svg.ts';
import {GET} from '../modules/fetch.ts'; import {GET} from '../modules/fetch.ts';
import {getIssueColor, getIssueIcon} from '../features/issue.ts'; import {getIssueColor, getIssueIcon} from '../features/issue.ts';
import {computed, onMounted, shallowRef} from 'vue'; import {computed, onMounted, shallowRef} from 'vue';
import type {Issue} from '../types.ts';
const props = defineProps<{ const props = defineProps<{
repoLink: string, repoLink: string,
@ -10,9 +11,9 @@ const props = defineProps<{
}>(); }>();
const loading = shallowRef(false); const loading = shallowRef(false);
const issue = shallowRef(null); const issue = shallowRef<Issue>(null);
const renderedLabels = shallowRef(''); const renderedLabels = shallowRef('');
const errorMessage = shallowRef(null); const errorMessage = shallowRef('');
const createdAt = computed(() => { const createdAt = computed(() => {
return new Date(issue.value.created_at).toLocaleDateString(undefined, {year: 'numeric', month: 'short', day: 'numeric'}); return new Date(issue.value.created_at).toLocaleDateString(undefined, {year: 'numeric', month: 'short', day: 'numeric'});
@ -25,7 +26,7 @@ const body = computed(() => {
onMounted(async () => { onMounted(async () => {
loading.value = true; loading.value = true;
errorMessage.value = null; errorMessage.value = '';
try { try {
const resp = await GET(props.loadIssueInfoUrl); const resp = await GET(props.loadIssueInfoUrl);
if (!resp.ok) { if (!resp.ok) {

View File

@ -52,14 +52,20 @@ export type IssuePageInfo = {
}; };
export type Issue = { export type Issue = {
id: number; id: number,
number: number; number: number,
title: string; title: string,
state: 'open' | 'closed'; body: string,
state: 'open' | 'closed',
created_at: string,
pull_request?: { pull_request?: {
draft: boolean; draft: boolean;
merged: boolean; merged: boolean;
}; },
repository: {
full_name: string,
},
labels: Array<string>,
}; };
export type FomanticInitFunction = { export type FomanticInitFunction = {