Skip to content

Commit fe25997

Browse files
authored
Enable vue/require-typed-ref eslint rule (#35764)
Enable https://eslint.vuejs.org/rules/require-typed-ref and fix discovered issues.
1 parent 95b18eb commit fe25997

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

eslint.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,7 @@ export default defineConfig([
924924
'vue/html-closing-bracket-spacing': [2, {startTag: 'never', endTag: 'never', selfClosingTag: 'never'}],
925925
'vue/max-attributes-per-line': [0],
926926
'vue/singleline-html-element-content-newline': [0],
927+
'vue/require-typed-ref': [2],
927928
},
928929
},
929930
{

web_src/js/components/ContextPopup.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@ import {SvgIcon} from '../svg.ts';
33
import {GET} from '../modules/fetch.ts';
44
import {getIssueColor, getIssueIcon} from '../features/issue.ts';
55
import {computed, onMounted, shallowRef} from 'vue';
6+
import type {Issue} from '../types.ts';
67
78
const props = defineProps<{
89
repoLink: string,
910
loadIssueInfoUrl: string,
1011
}>();
1112
1213
const loading = shallowRef(false);
13-
const issue = shallowRef(null);
14+
const issue = shallowRef<Issue>(null);
1415
const renderedLabels = shallowRef('');
15-
const errorMessage = shallowRef(null);
16+
const errorMessage = shallowRef('');
1617
1718
const createdAt = computed(() => {
1819
return new Date(issue.value.created_at).toLocaleDateString(undefined, {year: 'numeric', month: 'short', day: 'numeric'});
@@ -25,7 +26,7 @@ const body = computed(() => {
2526
2627
onMounted(async () => {
2728
loading.value = true;
28-
errorMessage.value = null;
29+
errorMessage.value = '';
2930
try {
3031
const resp = await GET(props.loadIssueInfoUrl);
3132
if (!resp.ok) {

web_src/js/types.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,20 @@ export type IssuePageInfo = {
5252
};
5353

5454
export type Issue = {
55-
id: number;
56-
number: number;
57-
title: string;
58-
state: 'open' | 'closed';
55+
id: number,
56+
number: number,
57+
title: string,
58+
body: string,
59+
state: 'open' | 'closed',
60+
created_at: string,
5961
pull_request?: {
6062
draft: boolean;
6163
merged: boolean;
62-
};
64+
},
65+
repository: {
66+
full_name: string,
67+
},
68+
labels: Array<string>,
6369
};
6470

6571
export type FomanticInitFunction = {

0 commit comments

Comments
 (0)