From 7429b866db67b4875f6f0285304829871822bfb9 Mon Sep 17 00:00:00 2001 From: gioboa Date: Wed, 1 Jan 2025 13:46:59 +0100 Subject: [PATCH] feat: apply no-unused-vars rule --- eslint.config.js | 1 - projects/ngx-indexed-db/src/lib/ngx-indexed-db.service.ts | 2 +- projects/ngx-indexed-db/src/lib/ngx-indexed-db.ts | 4 ++-- projects/ngx-indexed-db/src/lib/ngxindexeddb.module.ts | 2 +- projects/ngx-indexed-db/src/lib/provide-indexed-db.ts | 2 +- projects/ngx-indexed-db/src/utils/index.ts | 1 + projects/ssr-playground/src/app/app.config.ts | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 26e54c2..910ff66 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -36,7 +36,6 @@ module.exports = tseslint.config( "@typescript-eslint/consistent-indexed-object-style": "off", "@typescript-eslint/consistent-type-definitions": "off", "@typescript-eslint/no-explicit-any" : "off", - "@typescript-eslint/no-unused-vars": "off" }, }, { diff --git a/projects/ngx-indexed-db/src/lib/ngx-indexed-db.service.ts b/projects/ngx-indexed-db/src/lib/ngx-indexed-db.service.ts index e1c0f28..2dd5528 100644 --- a/projects/ngx-indexed-db/src/lib/ngx-indexed-db.service.ts +++ b/projects/ngx-indexed-db/src/lib/ngx-indexed-db.service.ts @@ -179,7 +179,7 @@ export class NgxIndexedDBService { const objectStore = transaction.objectStore(storeName); const results = values.map((value) => { - return new Promise((resolve1, reject1) => { + return new Promise((resolve1) => { const key = value.key; delete value.key; diff --git a/projects/ngx-indexed-db/src/lib/ngx-indexed-db.ts b/projects/ngx-indexed-db/src/lib/ngx-indexed-db.ts index 23c2634..320f75d 100644 --- a/projects/ngx-indexed-db/src/lib/ngx-indexed-db.ts +++ b/projects/ngx-indexed-db/src/lib/ngx-indexed-db.ts @@ -15,12 +15,12 @@ export function openDatabase( } const request = indexedDB.open(dbName, version); let db: IDBDatabase; - request.onsuccess = (event: Event) => { + request.onsuccess = () => { db = request.result; openedDatabases.push(db); resolve(db); }; - request.onerror = (event: Event) => { + request.onerror = () => { reject(`IndexedDB error: ${request.error}`); }; if (typeof upgradeCallback === 'function') { diff --git a/projects/ngx-indexed-db/src/lib/ngxindexeddb.module.ts b/projects/ngx-indexed-db/src/lib/ngxindexeddb.module.ts index cc8f8d2..8fc0ed9 100644 --- a/projects/ngx-indexed-db/src/lib/ngxindexeddb.module.ts +++ b/projects/ngx-indexed-db/src/lib/ngxindexeddb.module.ts @@ -1,4 +1,4 @@ -import { NgModule, ModuleWithProviders, InjectionToken } from '@angular/core'; +import { NgModule, ModuleWithProviders } from '@angular/core'; import { DBConfig } from './ngx-indexed-db.meta'; import { _provideIndexedDb } from './provide-indexed-db'; diff --git a/projects/ngx-indexed-db/src/lib/provide-indexed-db.ts b/projects/ngx-indexed-db/src/lib/provide-indexed-db.ts index c282811..1399f1c 100644 --- a/projects/ngx-indexed-db/src/lib/provide-indexed-db.ts +++ b/projects/ngx-indexed-db/src/lib/provide-indexed-db.ts @@ -1,5 +1,5 @@ import { makeEnvironmentProviders, Provider } from '@angular/core'; -import { DBConfig, CONFIG_TOKEN, INDEXED_DB, SERVER_INDEXED_DB } from './ngx-indexed-db.meta'; +import { DBConfig, CONFIG_TOKEN, INDEXED_DB } from './ngx-indexed-db.meta'; import { NgxIndexedDBService } from './ngx-indexed-db.service'; import { indexedDbFactory } from '../ssr'; diff --git a/projects/ngx-indexed-db/src/utils/index.ts b/projects/ngx-indexed-db/src/utils/index.ts index 6ddbafe..0864331 100644 --- a/projects/ngx-indexed-db/src/utils/index.ts +++ b/projects/ngx-indexed-db/src/utils/index.ts @@ -31,6 +31,7 @@ export function optionsGenerator( type: any, storeName: any, reject: (reason?: any) => void, + // eslint-disable-next-line @typescript-eslint/no-unused-vars resolve?: (e: any) => void ): Options { return { diff --git a/projects/ssr-playground/src/app/app.config.ts b/projects/ssr-playground/src/app/app.config.ts index fba577b..fafc3f9 100644 --- a/projects/ssr-playground/src/app/app.config.ts +++ b/projects/ssr-playground/src/app/app.config.ts @@ -3,7 +3,7 @@ import { provideRouter } from '@angular/router'; import { routes } from './app.routes'; import { provideClientHydration } from '@angular/platform-browser'; -import { provideIndexedDb, DBConfig, SERVER_INDEXED_DB } from 'ngx-indexed-db'; +import { provideIndexedDb, DBConfig } from 'ngx-indexed-db'; const dbConfig: DBConfig = { name: 'MyDb',