From a922fd8218c468cceb2cec20f345b51b08cd21ae Mon Sep 17 00:00:00 2001 From: beefchimi Date: Sun, 18 Aug 2024 17:48:33 -0400 Subject: [PATCH] :recycle: [Lint] Fix new linting issues --- config/tests-setup.ts | 2 ++ src/tests/Emitten.test.ts | 12 ++++++++---- src/types.ts | 2 ++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/config/tests-setup.ts b/config/tests-setup.ts index cfc5e8b..e26c20f 100644 --- a/config/tests-setup.ts +++ b/config/tests-setup.ts @@ -1,4 +1,6 @@ import {beforeEach, afterEach} from 'vitest'; +// eslint-disable-next-line @typescript-eslint/no-empty-function beforeEach(() => {}); +// eslint-disable-next-line @typescript-eslint/no-empty-function afterEach(() => {}); diff --git a/src/tests/Emitten.test.ts b/src/tests/Emitten.test.ts index cb84823..39a67ef 100644 --- a/src/tests/Emitten.test.ts +++ b/src/tests/Emitten.test.ts @@ -9,6 +9,9 @@ type MockEventMap = { qux: (required: string, ...optional: string[]) => void; }; +// eslint-disable-next-line @typescript-eslint/no-empty-function +function noop() {} + describe('Emitten full public members', () => { describe('Typed instance', () => { const mockTyped = new Emitten(); @@ -150,6 +153,7 @@ describe('Emitten full public members', () => { describe('Un-typed instance', () => { const mockDefault = new Emitten(); + // eslint-disable-next-line @typescript-eslint/no-explicit-any const handleSomething = vi.fn((anything?: any) => anything); it('accepts any event and listener signature', () => { @@ -209,10 +213,10 @@ describe('Emitten full public members', () => { }); it('retains a list of all active events', () => { - mockDefault.on('one', () => {}); - mockDefault.on('two', () => {}); - mockDefault.on('three', () => {}); - mockDefault.on('four', () => {}); + mockDefault.on('one', noop); + mockDefault.on('two', noop); + mockDefault.on('three', noop); + mockDefault.on('four', noop); expect(mockDefault.activeEvents).toStrictEqual([ 'one', diff --git a/src/types.ts b/src/types.ts index 1c877ed..0da664e 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,6 @@ export type EmittenKey = string | symbol; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any export type EmittenListener = ( ...values: V ) => void;