aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/features
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2024-08-10 11:46:48 +0200
committerGitHub <noreply@github.com>2024-08-10 09:46:48 +0000
commit32075d28803344230e6366e2a683b8d3f39b2433 (patch)
tree108dac3991866306f0809f289eeba7a0c5756159 /web_src/js/features
parent9633f336c87947dc7d2a5e76077a10699ba5e50d (diff)
downloadgitea-32075d28803344230e6366e2a683b8d3f39b2433.tar.gz
gitea-32075d28803344230e6366e2a683b8d3f39b2433.zip
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.
Diffstat (limited to 'web_src/js/features')
-rw-r--r--web_src/js/features/dropzone.ts2
-rw-r--r--web_src/js/features/repo-issue-list.ts2
-rw-r--r--web_src/js/features/repo-projects.ts6
-rw-r--r--web_src/js/features/stopwatch.ts2
4 files changed, 6 insertions, 6 deletions
diff --git a/web_src/js/features/dropzone.ts b/web_src/js/features/dropzone.ts
index 392bc1db66..f652af0456 100644
--- a/web_src/js/features/dropzone.ts
+++ b/web_src/js/features/dropzone.ts
@@ -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);
}
diff --git a/web_src/js/features/repo-issue-list.ts b/web_src/js/features/repo-issue-list.ts
index 1e4a880f2e..134304617b 100644
--- a/web_src/js/features/repo-issue-list.ts
+++ b/web_src/js/features/repo-issue-list.ts
@@ -196,7 +196,7 @@ async function initIssuePinSort() {
createSortable(pinDiv, {
group: 'shared',
- onEnd: pinMoveEnd,
+ onEnd: pinMoveEnd, // eslint-disable-line @typescript-eslint/no-misused-promises
});
}
diff --git a/web_src/js/features/repo-projects.ts b/web_src/js/features/repo-projects.ts
index 950d78fec7..bc2bb69a33 100644
--- a/web_src/js/features/repo-projects.ts
+++ b/web_src/js/features/repo-projects.ts
@@ -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,
});
diff --git a/web_src/js/features/stopwatch.ts b/web_src/js/features/stopwatch.ts
index d89aa4bfac..af52be4e24 100644
--- a/web_src/js/features/stopwatch.ts
+++ b/web_src/js/features/stopwatch.ts
@@ -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',