mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 19:38:23 +00:00 
			
		
		
		
	Add types to various low-level functions (#31781)
Adds types to various low-level modules. All changes are type-only, no runtime changes. `tsc` now reports 38 less errors. One problem was that `@types/sortablejs` does not accept promise return in its functions which triggered the linter, so I disabled the rules on those line.
This commit is contained in:
		| @@ -52,7 +52,7 @@ function addCopyLink(file) { | ||||
|   copyLinkEl.addEventListener('click', async (e) => { | ||||
|     e.preventDefault(); | ||||
|     const success = await clippie(generateMarkdownLinkForAttachment(file)); | ||||
|     showTemporaryTooltip(e.target, success ? i18n.copy_success : i18n.copy_error); | ||||
|     showTemporaryTooltip(e.target as Element, success ? i18n.copy_success : i18n.copy_error); | ||||
|   }); | ||||
|   file.previewTemplate.append(copyLinkEl); | ||||
| } | ||||
|   | ||||
| @@ -196,7 +196,7 @@ async function initIssuePinSort() { | ||||
|  | ||||
|   createSortable(pinDiv, { | ||||
|     group: 'shared', | ||||
|     onEnd: pinMoveEnd, | ||||
|     onEnd: pinMoveEnd, // eslint-disable-line @typescript-eslint/no-misused-promises | ||||
|   }); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -60,7 +60,7 @@ async function initRepoProjectSortable() { | ||||
|     handle: '.project-column-header', | ||||
|     delayOnTouchOnly: true, | ||||
|     delay: 500, | ||||
|     onSort: async () => { | ||||
|     onSort: async () => { // eslint-disable-line @typescript-eslint/no-misused-promises | ||||
|       boardColumns = mainBoard.querySelectorAll('.project-column'); | ||||
|  | ||||
|       const columnSorting = { | ||||
| @@ -84,8 +84,8 @@ async function initRepoProjectSortable() { | ||||
|     const boardCardList = boardColumn.querySelectorAll('.cards')[0]; | ||||
|     createSortable(boardCardList, { | ||||
|       group: 'shared', | ||||
|       onAdd: moveIssue, | ||||
|       onUpdate: moveIssue, | ||||
|       onAdd: moveIssue, // eslint-disable-line @typescript-eslint/no-misused-promises | ||||
|       onUpdate: moveIssue, // eslint-disable-line @typescript-eslint/no-misused-promises | ||||
|       delayOnTouchOnly: true, | ||||
|       delay: 500, | ||||
|     }); | ||||
|   | ||||
| @@ -27,7 +27,7 @@ export function initStopwatch() { | ||||
|     stopwatchEl.removeAttribute('href'); // intended for noscript mode only | ||||
|  | ||||
|     createTippy(stopwatchEl, { | ||||
|       content: stopwatchPopup.cloneNode(true), | ||||
|       content: stopwatchPopup.cloneNode(true) as Element, | ||||
|       placement: 'bottom-end', | ||||
|       trigger: 'click', | ||||
|       maxWidth: 'none', | ||||
|   | ||||
		Reference in New Issue
	
	Block a user