From 8d0393542bd712d7bb7f93874118dedd07b62c7b Mon Sep 17 00:00:00 2001 From: Federico Brigante Date: Sat, 31 Aug 2019 01:26:28 +0700 Subject: Update dependencies and lint (#2391) --- source/background.ts | 2 +- source/features/follow-file-renames.tsx | 4 ++-- source/features/forked-to.tsx | 2 +- source/features/hide-useless-comments.tsx | 2 +- source/features/link-to-file-in-file-history.tsx | 3 +-- source/features/linkify-urls-in-code.tsx | 2 +- source/features/minimize-upload-bar.tsx | 2 +- source/features/pr-branch-auto-delete.tsx | 2 +- source/features/revert-file.tsx | 11 +++++------ source/features/show-names.tsx | 2 +- source/features/sticky-discussion-sidebar.tsx | 2 +- source/features/submit-review-as-single-comment.tsx | 2 +- source/features/tags-dropdown.tsx | 2 +- source/features/view-markdown-source.tsx | 4 ++-- source/globals.d.ts | 19 +++++++------------ source/libs/features.tsx | 4 ++-- source/libs/get-default-branch.ts | 6 ++---- source/libs/get-text-nodes.ts | 2 +- source/libs/on-new-comments.ts | 1 + source/libs/post-form.ts | 2 +- source/options-storage.ts | 4 ++-- source/options.tsx | 2 +- 22 files changed, 37 insertions(+), 45 deletions(-) (limited to 'source') diff --git a/source/background.ts b/source/background.ts index 59876081..cb3f1a5e 100644 --- a/source/background.ts +++ b/source/background.ts @@ -2,7 +2,7 @@ import 'webext-dynamic-content-scripts'; import addDomainPermissionToggle from 'webext-domain-permission-toggle'; import './options-storage'; -browser.runtime.onMessage.addListener(async (message, {tab}) => { +browser.runtime.onMessage.addListener((message, {tab}) => { if (message && Array.isArray(message.openUrls)) { for (const [i, url] of (message.openUrls as string[]).entries()) { browser.tabs.create({ diff --git a/source/features/follow-file-renames.tsx b/source/features/follow-file-renames.tsx index 0657f386..0f50ccf3 100644 --- a/source/features/follow-file-renames.tsx +++ b/source/features/follow-file-renames.tsx @@ -17,10 +17,10 @@ async function findRename( ): Promise { // API v4 doesn't support it: https://github.community/t5/GitHub-API-Development-and/What-is-the-corresponding-object-in-GraphQL-API-v4-for-patch/m-p/14502?collapse_discussion=true&filter=location&location=board:api&q=files%20changed%20commit&search_type=thread const {files} = await api.v3(`repos/${user}/${repo}/commits/${lastCommitOnPage}`); - return files as Promise; + return files as File[]; } -async function init(): Promise { +function init(): false | void { const disabledPagination = select.all('.paginate-container [disabled], .paginate-container .disabled'); if (disabledPagination.length === 0) { diff --git a/source/features/forked-to.tsx b/source/features/forked-to.tsx index 867a9467..33e44e29 100644 --- a/source/features/forked-to.tsx +++ b/source/features/forked-to.tsx @@ -17,7 +17,7 @@ async function save(forks: string[]): Promise { return cache.set(getCacheKey(), forks, 10); } -async function saveAllForks(): Promise { +function saveAllForks(): void { const forks = select .all('details-dialog[src*="/fork"] .octicon-repo-forked') .map(({nextSibling}) => nextSibling!.textContent!.trim()); diff --git a/source/features/hide-useless-comments.tsx b/source/features/hide-useless-comments.tsx index 98accf05..df40a45f 100644 --- a/source/features/hide-useless-comments.tsx +++ b/source/features/hide-useless-comments.tsx @@ -17,7 +17,7 @@ function init(): void { } // Ensure that they're not by VIPs (owner, collaborators, etc) - const comment = commentText.closest('.js-timeline-item') as HTMLElement; + const comment = commentText.closest('.js-timeline-item')!; if (select.exists('.timeline-comment-label', comment)) { continue; } diff --git a/source/features/link-to-file-in-file-history.tsx b/source/features/link-to-file-in-file-history.tsx index 69591b1d..e754a40d 100644 --- a/source/features/link-to-file-in-file-history.tsx +++ b/source/features/link-to-file-in-file-history.tsx @@ -25,8 +25,7 @@ function init(): void | false { ); - // TODO: drop `as` after https://github.com/Microsoft/TSJS-lib-generator/pull/697 - (rootLink.closest('.commit-links-cell') as HTMLElement).style.width = 'auto'; + rootLink.closest('.commit-links-cell')!.style.width = 'auto'; groupSiblings(rootLink); } diff --git a/source/features/linkify-urls-in-code.tsx b/source/features/linkify-urls-in-code.tsx index 066bfef3..9e9ca6a1 100644 --- a/source/features/linkify-urls-in-code.tsx +++ b/source/features/linkify-urls-in-code.tsx @@ -12,7 +12,7 @@ export function linkifyIssuesInDom(element: Element): void { } // Enable native issue title fetch - for (const link of (linkified.children as HTMLCollectionOf)) { + for (const link of linkified.children as HTMLCollectionOf) { const issue = link.href.split('/').pop(); link.setAttribute('class', 'issue-link js-issue-link tooltipped tooltipped-ne'); link.setAttribute('data-error-text', 'Failed to load issue title'); diff --git a/source/features/minimize-upload-bar.tsx b/source/features/minimize-upload-bar.tsx index a325388d..db0d3ceb 100644 --- a/source/features/minimize-upload-bar.tsx +++ b/source/features/minimize-upload-bar.tsx @@ -5,7 +5,7 @@ import delegate, {DelegateEvent} from 'delegate-it'; import features from '../libs/features'; import * as icons from '../libs/icons'; -async function addButton(): Promise { +function addButton(): void { for (const toolbarButton of select.all('md-ref')) { toolbarButton.after(