Skip to content

Commit

Permalink
♻️ [Lint] Fix new linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
beefchimi committed Aug 18, 2024
1 parent 6b98013 commit a922fd8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions config/tests-setup.ts
Original file line number Diff line number Diff line change
@@ -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(() => {});
12 changes: 8 additions & 4 deletions src/tests/Emitten.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<MockEventMap>();
Expand Down Expand Up @@ -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', () => {
Expand Down Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export type EmittenKey = string | symbol;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type EmittenListener<V extends readonly unknown[] = any[]> = (
...values: V
) => void;
Expand Down

0 comments on commit a922fd8

Please sign in to comment.