diff --git a/.eslintrc.js b/.eslintrc.js index 60a493795f2..e0ed6475d1f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -70,7 +70,6 @@ module.exports = { leadingUnderscore: 'allow', }, ], - '@typescript-eslint/no-empty-function': 'error', '@typescript-eslint/no-empty-interface': 'off', '@typescript-eslint/no-explicit-any': ['warn'], '@typescript-eslint/no-floating-promises': 'error', @@ -111,14 +110,13 @@ module.exports = { 'no-control-regex': 0, 'no-debugger': 'error', 'no-empty': 'error', - 'no-empty-function': 'error', 'no-empty-pattern': 0, 'no-eval': 'error', 'no-fallthrough': 0, 'no-invalid-this': 'off', 'no-new-wrappers': 'error', 'no-null/no-null': 'error', - 'no-only-tests/no-only-tests': ['error', { block: ['ava.default'] }], + 'no-only-tests/no-only-tests': ['error'], 'no-prototype-builtins': 0, 'no-shadow': 'off', 'no-throw-literal': 'error', @@ -128,7 +126,6 @@ module.exports = { 'no-unsafe-finally': 'error', 'no-unused-expressions': 'off', 'no-unused-labels': 'error', - 'no-unused-vars': 0, 'no-use-before-define': 'off', 'no-useless-escape': 0, 'no-var': 'error', diff --git a/conf/tsconfig.test.json b/conf/tsconfig.test.json index a56c5bc734e..0c35bd97ab5 100644 --- a/conf/tsconfig.test.json +++ b/conf/tsconfig.test.json @@ -17,7 +17,6 @@ "../test/source/test.ts", "../test/source/patterns.ts", "../test/source/async-stack.ts", - "../test/source/buf.ts", - "../test/source/mock.ts" + "../test/source/buf.ts" ] } diff --git a/extension/chrome/elements/attachment.ts b/extension/chrome/elements/attachment.ts index c9749da364d..9d0cb815f82 100644 --- a/extension/chrome/elements/attachment.ts +++ b/extension/chrome/elements/attachment.ts @@ -103,8 +103,7 @@ export class AttachmentDownloadView extends View { $('img#file-format').attr('src', this.getFileIconSrc()); if (!this.size && this.url) { // download url of a file that has an unknown size - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - this.getUrlFileSize(this.url!) + this.getUrlFileSize(this.url) .then(fileSize => { if (typeof fileSize !== 'undefined') { this.size = fileSize; @@ -213,8 +212,7 @@ export class AttachmentDownloadView extends View { console.info('trying to figure out figetUrlFileSizee size'); if (url.indexOf('docs.googleusercontent.getUrlFileSizeom/docs/securesc') !== -1) { try { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const googleDriveFileId = url.split('/').pop()!.split('?').shift(); // try and catch any errors below if structure is not as expected + const googleDriveFileId = url.split('/').pop()?.split('?').shift(); // try and catch any errors below if structure is not as expected url = googleDriveFileId ? `https://drive.google.com/uc?export=download&id=${googleDriveFileId}` : url; // attempt to get length headers from Google Drive file if available } catch (e) { // leave url as is diff --git a/extension/chrome/elements/backup.ts b/extension/chrome/elements/backup.ts index 230ed04b353..78405558c18 100644 --- a/extension/chrome/elements/backup.ts +++ b/extension/chrome/elements/backup.ts @@ -72,8 +72,7 @@ View.run( }; private sendResizeMsg = () => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const desiredHeight = $('#backup_block').height()!; + const desiredHeight = $('#backup_block').height(); BrowserMsg.send.setCss(this.parentTabId, { selector: `iframe#${this.frameId}`, css: { height: `${desiredHeight}px` }, diff --git a/extension/chrome/elements/pgp_block_modules/pgp-block-attachmens-module.ts b/extension/chrome/elements/pgp_block_modules/pgp-block-attachmens-module.ts index f449c9c6421..e0b0b37a173 100644 --- a/extension/chrome/elements/pgp_block_modules/pgp-block-attachmens-module.ts +++ b/extension/chrome/elements/pgp_block_modules/pgp-block-attachmens-module.ts @@ -17,7 +17,7 @@ declare const filesize: { filesize: Function }; // eslint-disable-line @typescri export class PgpBlockViewAttachmentsModule { public includedAttachments: Attachment[] = []; - public constructor(private view: PgpBlockView) {} // eslint-disable-line no-empty-function + public constructor(private view: PgpBlockView) {} public renderInnerAttachments = (attachments: Attachment[], isEncrypted: boolean) => { Xss.sanitizeAppend('#pgp_block', '
'); diff --git a/extension/chrome/elements/pgp_block_modules/pgp-block-decrypt-module.ts b/extension/chrome/elements/pgp_block_modules/pgp-block-decrypt-module.ts index a85e4d0e8d2..67a2096644c 100644 --- a/extension/chrome/elements/pgp_block_modules/pgp-block-decrypt-module.ts +++ b/extension/chrome/elements/pgp_block_modules/pgp-block-decrypt-module.ts @@ -18,7 +18,6 @@ export class PgpBlockViewDecryptModule { private msgFetchedFromApi: false | GmailResponseFormat = false; private isPwdMsgBasedOnMsgSnippet: boolean | undefined; - // eslint-disable-next-line no-empty-function public constructor(private view: PgpBlockView) {} public initialize = async (verificationPubs: string[], forcePullMsgFromApi: boolean) => { diff --git a/extension/chrome/elements/pgp_block_modules/pgp-block-error-module.ts b/extension/chrome/elements/pgp_block_modules/pgp-block-error-module.ts index ed0d4330987..56908bbbfd0 100644 --- a/extension/chrome/elements/pgp_block_modules/pgp-block-error-module.ts +++ b/extension/chrome/elements/pgp_block_modules/pgp-block-error-module.ts @@ -16,7 +16,6 @@ import { Str } from '../../../js/common/core/common.js'; export class PgpBlockViewErrorModule { private debugId = Str.sloppyRandom(); - // eslint-disable-next-line no-empty-function public constructor(private view: PgpBlockView) {} public renderErr = async (errBoxContent: string, renderRawMsg: string | undefined, errMsg?: string) => { diff --git a/extension/chrome/elements/pgp_block_modules/pgp-block-quote-module.ts b/extension/chrome/elements/pgp_block_modules/pgp-block-quote-module.ts index 3d0e02db33d..f3f83e1e9e9 100644 --- a/extension/chrome/elements/pgp_block_modules/pgp-block-quote-module.ts +++ b/extension/chrome/elements/pgp_block_modules/pgp-block-quote-module.ts @@ -7,7 +7,7 @@ import { Str } from '../../../js/common/core/common.js'; import { Xss } from '../../../js/common/platform/xss.js'; export class PgpBlockViewQuoteModule { - public constructor(private view: PgpBlockView) {} // eslint-disable-line no-empty-function + public constructor(private view: PgpBlockView) {} public separateQuotedContentAndRenderText = async (decryptedContent: string, isHtml: boolean) => { if (isHtml) { diff --git a/extension/chrome/elements/pgp_block_modules/pgp-block-render-module.ts b/extension/chrome/elements/pgp_block_modules/pgp-block-render-module.ts index 562ef865ed9..b4c1739f0df 100644 --- a/extension/chrome/elements/pgp_block_modules/pgp-block-render-module.ts +++ b/extension/chrome/elements/pgp_block_modules/pgp-block-render-module.ts @@ -23,7 +23,6 @@ export class PgpBlockViewRenderModule { private heightHist: number[] = []; private printMailInfoHtml!: string; - // eslint-disable-next-line no-empty-function public constructor(private view: PgpBlockView) {} public initPrintView = async () => { @@ -133,14 +132,12 @@ export class PgpBlockViewRenderModule {