From f9c2bf29489a35cb41e211886de63369280eff9d Mon Sep 17 00:00:00 2001 From: David Luna Date: Sun, 19 May 2024 15:53:56 +0200 Subject: [PATCH] chore: fix lint issues --- lib/factories/fromEvent.js | 9 ++------- lib/utils/pipe.js | 1 - package.json | 3 +-- test/factories/combineLatest.test.js | 1 - test/factories/fromEvent.test.js | 1 - test/operators/mergeMap.test.js | 2 +- 6 files changed, 4 insertions(+), 13 deletions(-) diff --git a/lib/factories/fromEvent.js b/lib/factories/fromEvent.js index 4bfc832..4c26a5e 100644 --- a/lib/factories/fromEvent.js +++ b/lib/factories/fromEvent.js @@ -13,7 +13,6 @@ // ): void; // } - // export interface EventEmitterLike void> { // addListener( // type: string, @@ -27,8 +26,6 @@ // ): void; // } - - import { createObsevable } from '../observable.js'; /** @@ -70,8 +67,6 @@ import { createObsevable } from '../observable.js'; * @typedef {T extends EventEmitterLike ? Parameters : EventParam} EventOrParams */ - - /** * @param {EventTargetLike} target * @param {string} eventName @@ -106,8 +101,8 @@ function fromEventEmitter(target, eventName) { /** * @template {EventTargetLike | EventEmitterLike} T - * @param {T} target - * @param {string} eventName + * @param {T} target + * @param {string} eventName * @returns {import('../observable').Observable>} */ export function fromEvent(target, eventName) { diff --git a/lib/utils/pipe.js b/lib/utils/pipe.js index c179327..7a9a128 100644 --- a/lib/utils/pipe.js +++ b/lib/utils/pipe.js @@ -5,7 +5,6 @@ * @returns {R} */ - /** * @template T * @overload diff --git a/package.json b/package.json index f563f26..cc614c1 100644 --- a/package.json +++ b/package.json @@ -15,13 +15,12 @@ }, "scripts": { "test": "node --test", - "test:lcov": "node --test --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=test-report-lcov.info", - "test:junit": "node --test --test-reporter=junit --test-reporter-destination=test-report-junit.xml", "test:ci": "node --test --experimental-test-coverage --test-reporter=./test/lcov-reporter.js --test-reporter-destination=test-report-lcov.info", "lcov": "cat test-report-lcov.info | coveralls", "lint": "npm run lint:js && npm run lint:ts", "lint:js": "eslint 'lib/**/*.js' 'test/**/*.js'", "lint:ts": "rm -rf build && tsc && diff -ur types build/lib", + "lint:fix": "eslint 'lib/**/*.js' 'test/**/*.js' --fix", "gen:types": "rm -rf build types && tsc && mv build/lib types", "clean": "rm -rf build" }, diff --git a/test/factories/combineLatest.test.js b/test/factories/combineLatest.test.js index 4373a5e..c152ebf 100644 --- a/test/factories/combineLatest.test.js +++ b/test/factories/combineLatest.test.js @@ -127,4 +127,3 @@ test('combineLatest - should complete when all source observables complete', () assert.strictEqual(sourceStrings.mocks.tearDown.mock.callCount(), 1); assert.strictEqual(sourceBooleans.mocks.tearDown.mock.callCount(), 1); }); - diff --git a/test/factories/fromEvent.test.js b/test/factories/fromEvent.test.js index 7992eaa..8c8259f 100644 --- a/test/factories/fromEvent.test.js +++ b/test/factories/fromEvent.test.js @@ -45,4 +45,3 @@ test('fromEvent - should be able to get an observable from EventTarget', () => { assert.strictEqual(observerMock.error.mock.callCount(), 0); assert.strictEqual(observerMock.complete.mock.callCount(), 0); }); - diff --git a/test/operators/mergeMap.test.js b/test/operators/mergeMap.test.js index 63ebf7a..0c3948e 100644 --- a/test/operators/mergeMap.test.js +++ b/test/operators/mergeMap.test.js @@ -103,7 +103,7 @@ test('mergeMap - should error from any of the projected observables', () => { assert.deepStrictEqual(nextMock.calls[index].arguments, [valuesToEmit[index]]); } assert.strictEqual(errorMock.callCount(), 1); - assert.strictEqual(errorMock.calls[0].arguments[0].message, 'explosion in projected observable') + assert.strictEqual(errorMock.calls[0].arguments[0].message, 'explosion in projected observable'); assert.strictEqual(completeMock.callCount(), 0); assert.strictEqual(tearDownMock.callCount(), 1); observableMocks.forEach((obsMock) => {