mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-04 04:14:01 +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:
		
							parent
							
								
									95b18eb781
								
							
						
					
					
						commit
						fe25997157
					
				@ -924,6 +924,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],
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
 | 
			
		||||
@ -3,6 +3,7 @@ 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,
 | 
			
		||||
@ -10,9 +11,9 @@ const props = defineProps<{
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
const loading = shallowRef(false);
 | 
			
		||||
const issue = shallowRef(null);
 | 
			
		||||
const issue = shallowRef<Issue>(null);
 | 
			
		||||
const renderedLabels = shallowRef('');
 | 
			
		||||
const errorMessage = shallowRef(null);
 | 
			
		||||
const errorMessage = shallowRef('');
 | 
			
		||||
 | 
			
		||||
const createdAt = computed(() => {
 | 
			
		||||
  return new Date(issue.value.created_at).toLocaleDateString(undefined, {year: 'numeric', month: 'short', day: 'numeric'});
 | 
			
		||||
@ -25,7 +26,7 @@ const body = computed(() => {
 | 
			
		||||
 | 
			
		||||
onMounted(async () => {
 | 
			
		||||
  loading.value = true;
 | 
			
		||||
  errorMessage.value = null;
 | 
			
		||||
  errorMessage.value = '';
 | 
			
		||||
  try {
 | 
			
		||||
    const resp = await GET(props.loadIssueInfoUrl);
 | 
			
		||||
    if (!resp.ok) {
 | 
			
		||||
 | 
			
		||||
@ -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<string>,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export type FomanticInitFunction = {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user