From beebb6ffe5ec5677e4c8cf406f0f65f9ae89d32c Mon Sep 17 00:00:00 2001 From: Oliver Blanthorn Date: Fri, 19 Jun 2020 13:11:03 +0100 Subject: [PATCH] Re-enable `unified-signatures` --- .eslintrc.js | 2 +- src/tridactyl.d.ts | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 201edee3..0471ce29 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -154,7 +154,7 @@ module.exports = { ], "@typescript-eslint/type-annotation-spacing": "error", "@typescript-eslint/unbound-method": "off", //"error", - "@typescript-eslint/unified-signatures": "off", //"error", + "@typescript-eslint/unified-signatures": "error", "arrow-body-style": "error", "arrow-parens": [ "off", diff --git a/src/tridactyl.d.ts b/src/tridactyl.d.ts index 43add7b2..3eb066fd 100644 --- a/src/tridactyl.d.ts +++ b/src/tridactyl.d.ts @@ -48,9 +48,7 @@ interface findResult { interface HTMLElement { // Let's be future proof: // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus - focus(options: any): void - // Let's also implement the current function signature. - focus(): void + focus(options?: any): void } /* eslint-disable @typescript-eslint/ban-types */ @@ -67,9 +65,10 @@ declare namespace browser.find { function find(query, object): any } -// setZoom has an optional first argument of tabId. Unclear how first argument can be optional. declare namespace browser.tabs { function setZoom(zoomFactor: number): Promise + // setZoom has an optional first argument of tabId: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/setZoom#Parameters + // eslint-disable-next-line @typescript-eslint/unified-signatures function setZoom(tabId: number, zoomFactor: number): Promise function toggleReaderMode(tabId?: number): Promise }