0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-12-05 03:34:40 +01:00

Enable vue/require-typed-ref eslint rule

This commit is contained in:
silverwind 2025-10-28 18:26:45 +01:00
parent 91839ca01a
commit 62fb4caf3f
No known key found for this signature in database
GPG Key ID: 2E62B41C93869443
3 changed files with 17 additions and 9 deletions

View File

@ -921,6 +921,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,16 +3,17 @@ 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,
loadIssueInfoUrl: string, loadIssueInfoUrl: string,
}>(); }>();
const loading = shallowRef(false); const loading = shallowRef<boolean>(false);
const issue = shallowRef(null); const issue = shallowRef<Issue>(null);
const renderedLabels = shallowRef(''); const renderedLabels = shallowRef<string>('');
const errorMessage = shallowRef(null); const errorMessage = shallowRef<string | null>(null);
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'});

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 = {