From c2c95b4fab2b37f853bddbc2822b08558fbcd8d6 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 24 Jan 2024 15:14:46 +0100 Subject: [PATCH 1/2] meta: disable `@typescript-eslint/no-empty-function` lint rule --- .eslintrc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc.js b/.eslintrc.js index a91ba927a4..ba081a4782 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -53,6 +53,7 @@ module.exports = { 'react/no-unknown-property': ['error', { ignore: svgPresentationAttributes, }], + '@typescript-eslint/no-empty-function': 'off', // Special rules for CI: ...(process.env.CI && { From 8ceadfb66e78df35f5a69f14712a7b000dbc05f7 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 24 Jan 2024 15:24:04 +0100 Subject: [PATCH 2/2] f --- .eslintrc.js | 2 +- packages/@uppy/audio/src/audio-oscilloscope/index.ts | 5 +---- packages/@uppy/core/src/BasePlugin.ts | 1 - packages/@uppy/core/src/UIPlugin.ts | 1 - packages/@uppy/core/src/Uppy.test.ts | 3 --- packages/@uppy/core/src/loggers.ts | 1 - packages/@uppy/core/types/index.test-d.ts | 2 -- 7 files changed, 2 insertions(+), 13 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index ba081a4782..2c643ed905 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -53,7 +53,6 @@ module.exports = { 'react/no-unknown-property': ['error', { ignore: svgPresentationAttributes, }], - '@typescript-eslint/no-empty-function': 'off', // Special rules for CI: ...(process.env.CI && { @@ -463,6 +462,7 @@ module.exports = { ], rules: { 'import/prefer-default-export': 'off', + '@typescript-eslint/no-empty-function': 'off', '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-extra-semi': 'off', '@typescript-eslint/no-namespace': 'off', diff --git a/packages/@uppy/audio/src/audio-oscilloscope/index.ts b/packages/@uppy/audio/src/audio-oscilloscope/index.ts index f60b05406c..f41d665fc6 100644 --- a/packages/@uppy/audio/src/audio-oscilloscope/index.ts +++ b/packages/@uppy/audio/src/audio-oscilloscope/index.ts @@ -76,10 +76,7 @@ export default class AudioOscilloscope { result(canvasContextOptions.strokeStyle) || 'rgb(0, 0, 0)' this.canvasContext.lineWidth = result(canvasContextOptions.lineWidth) || 1 this.onDrawFrame = - isFunction(options.onDrawFrame) ? - options.onDrawFrame - // eslint-disable-next-line @typescript-eslint/no-empty-function - : () => {} + isFunction(options.onDrawFrame) ? options.onDrawFrame : () => {} } addSource(streamSource: MediaStreamAudioSourceNode): void { diff --git a/packages/@uppy/core/src/BasePlugin.ts b/packages/@uppy/core/src/BasePlugin.ts index 5c31519689..b4bcc2fe91 100644 --- a/packages/@uppy/core/src/BasePlugin.ts +++ b/packages/@uppy/core/src/BasePlugin.ts @@ -1,5 +1,4 @@ /* eslint-disable class-methods-use-this */ -/* eslint-disable @typescript-eslint/no-empty-function */ /** * Core plugin logic that all plugins share. diff --git a/packages/@uppy/core/src/UIPlugin.ts b/packages/@uppy/core/src/UIPlugin.ts index 36099ee2f9..14b21e7cc8 100644 --- a/packages/@uppy/core/src/UIPlugin.ts +++ b/packages/@uppy/core/src/UIPlugin.ts @@ -1,5 +1,4 @@ /* eslint-disable class-methods-use-this */ -/* eslint-disable @typescript-eslint/no-empty-function */ import { render, type ComponentChild } from 'preact' import findDOMElement from '@uppy/utils/lib/findDOMElement' import getTextDirection from '@uppy/utils/lib/getTextDirection' diff --git a/packages/@uppy/core/src/Uppy.test.ts b/packages/@uppy/core/src/Uppy.test.ts index 7b6ab8e85b..04b4e61971 100644 --- a/packages/@uppy/core/src/Uppy.test.ts +++ b/packages/@uppy/core/src/Uppy.test.ts @@ -611,7 +611,6 @@ describe('src/Core', () => { describe('preprocessors', () => { it('should add and remove preprocessor', () => { const core = new Core() - // eslint-disable-next-line @typescript-eslint/no-empty-function const preprocessor = () => {} expect(core.removePreProcessor(preprocessor)).toBe(false) core.addPreProcessor(preprocessor) @@ -731,7 +730,6 @@ describe('src/Core', () => { describe('postprocessors', () => { it('should add and remove postprocessor', () => { const core = new Core() - // eslint-disable-next-line @typescript-eslint/no-empty-function const postprocessor = () => {} expect(core.removePostProcessor(postprocessor)).toBe(false) core.addPostProcessor(postprocessor) @@ -849,7 +847,6 @@ describe('src/Core', () => { describe('uploaders', () => { it('should add and remove uploader', () => { const core = new Core() - // eslint-disable-next-line @typescript-eslint/no-empty-function const uploader = () => {} expect(core.removeUploader(uploader)).toBe(false) core.addUploader(uploader) diff --git a/packages/@uppy/core/src/loggers.ts b/packages/@uppy/core/src/loggers.ts index db792fabf8..5f9c02c495 100644 --- a/packages/@uppy/core/src/loggers.ts +++ b/packages/@uppy/core/src/loggers.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-empty-function */ /* eslint-disable no-console */ import getTimeStamp from '@uppy/utils/lib/getTimeStamp' diff --git a/packages/@uppy/core/types/index.test-d.ts b/packages/@uppy/core/types/index.test-d.ts index 4ff053cab9..fcffd72337 100644 --- a/packages/@uppy/core/types/index.test-d.ts +++ b/packages/@uppy/core/types/index.test-d.ts @@ -80,7 +80,6 @@ type anyObject = Record { // Meta signature type Meta = { myCustomMetadata: string } - /* eslint-disable @typescript-eslint/no-empty-function */ const uppy = new Uppy() // can emit events with internal event types uppy.emit('upload') @@ -97,7 +96,6 @@ type anyObject = Record uppy.once('upload', () => {}) uppy.once('complete', () => {}) uppy.once('error', () => {}) - /* eslint-enable @typescript-eslint/no-empty-function */ // Normal event signature uppy.on('complete', (result) => {