Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Linting refactor (#1404)

Leendert de Borsta566d81c44d7
diff --git a/apps/browser-extension/src/entrypoints/background/PasskeyHandler.ts b/apps/browser-extension/src/entrypoints/background/PasskeyHandler.ts
index 381dea23e..23f78b549 100644
--- a/apps/browser-extension/src/entrypoints/background/PasskeyHandler.ts
+++ b/apps/browser-extension/src/entrypoints/background/PasskeyHandler.ts
@@ -10,6 +10,7 @@ import {
PASSKEY_DISABLED_SITES_KEY
} from '@/utils/Constants';
import { extractDomain, extractRootDomain } from '@/utils/credentialMatcher/CredentialMatcher';
+import type { PasskeyWithItem } from '@/utils/db/mappers/PasskeyMapper';
import { EncryptionUtility } from '@/utils/EncryptionUtility';
import { PasskeyHelper } from '@/utils/passkey/PasskeyHelper';
import type {
@@ -24,7 +25,6 @@ import type {
WebAuthnPublicKeyGetPayload
} from '@/utils/passkey/types';
import { SqliteClient } from '@/utils/SqliteClient';
-import type { PasskeyWithItem } from '@/utils/db/mappers/PasskeyMapper';
import { browser, storage } from '#imports';
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/passkeys/PasskeyCreate.tsx b/apps/browser-extension/src/entrypoints/popup/pages/passkeys/PasskeyCreate.tsx
index f39d08749..c1f3e5251 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/passkeys/PasskeyCreate.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/passkeys/PasskeyCreate.tsx
@@ -7,7 +7,6 @@ import Alert from '@/entrypoints/popup/components/Alert';
import Button from '@/entrypoints/popup/components/Button';
import PasskeyBypassDialog from '@/entrypoints/popup/components/Dialogs/PasskeyBypassDialog';
import { FormInput } from '@/entrypoints/popup/components/Forms/FormInput';
-import ItemIcon from '@/entrypoints/popup/components/Items/ItemIcon';
import LoadingSpinner from '@/entrypoints/popup/components/LoadingSpinner';
import { useDb } from '@/entrypoints/popup/context/DbContext';
import { useLoading } from '@/entrypoints/popup/context/LoadingContext';
diff --git a/apps/browser-extension/src/utils/db/BaseRepository.ts b/apps/browser-extension/src/utils/db/BaseRepository.ts
index 85a3796a0..d27d1dcb9 100644
--- a/apps/browser-extension/src/utils/db/BaseRepository.ts
+++ b/apps/browser-extension/src/utils/db/BaseRepository.ts
@@ -1,7 +1,7 @@
-import type { Database } from 'sql.js';
-
import * as dateFormatter from '@/utils/dateFormatter';
+import type { Database } from 'sql.js';
+
export type SqliteBindValue = string | number | null | Uint8Array;
/**
@@ -21,7 +21,11 @@ export interface IDatabaseClient {
* Provides transaction handling, soft delete, and other shared functionality.
*/
export abstract class BaseRepository {
- constructor(protected client: IDatabaseClient) {}
+ /**
+ * Constructor for the BaseRepository class.
+ * @param client - The database client to use for the repository
+ */
+ protected constructor(protected client: IDatabaseClient) {}
/**
* Execute a function within a transaction.
diff --git a/apps/browser-extension/src/utils/db/mappers/FieldMapper.ts b/apps/browser-extension/src/utils/db/mappers/FieldMapper.ts
index 54ac09e44..d50fa5c19 100644
--- a/apps/browser-extension/src/utils/db/mappers/FieldMapper.ts
+++ b/apps/browser-extension/src/utils/db/mappers/FieldMapper.ts
@@ -4,7 +4,7 @@ import { FieldTypes, getSystemField } from '@/utils/dist/core/models/vault';
/**
* Raw field row from database query.
*/
-export interface FieldRow {
+export type FieldRow = {
ItemId: string;
FieldKey: string | null;
FieldDefinitionId: string | null;
@@ -18,7 +18,7 @@ export interface FieldRow {
/**
* Intermediate field representation before grouping.
*/
-interface ProcessedField {
+export type ProcessedField = {
ItemId: string;
FieldKey: string;
Label: string;
diff --git a/apps/browser-extension/src/utils/db/mappers/ItemMapper.ts b/apps/browser-extension/src/utils/db/mappers/ItemMapper.ts
index 5bda5a4fe..88f464e37 100644
--- a/apps/browser-extension/src/utils/db/mappers/ItemMapper.ts
+++ b/apps/browser-extension/src/utils/db/mappers/ItemMapper.ts
@@ -8,7 +8,7 @@ export type ItemWithDeletedAt = Item & { DeletedAt?: string };
/**
* Raw item row from database query.
*/
-export interface ItemRow {
+export type ItemRow = {
Id: string;
Name: string;
ItemType: string;
@@ -26,7 +26,7 @@ export interface ItemRow {
/**
* Raw tag row from database query.
*/
-export interface TagRow {
+export type TagRow = {
ItemId: string;
Id: string;
Name: string;
diff --git a/apps/browser-extension/src/utils/db/mappers/PasskeyMapper.ts b/apps/browser-extension/src/utils/db/mappers/PasskeyMapper.ts
index aebca16b8..9bd6875a8 100644
--- a/apps/browser-extension/src/utils/db/mappers/PasskeyMapper.ts
+++ b/apps/browser-extension/src/utils/db/mappers/PasskeyMapper.ts
@@ -3,7 +3,7 @@ import type { Passkey } from '@/utils/dist/core/models/vault';
/**
* Raw passkey row from database query.
*/
-export interface PasskeyRow {
+export type PasskeyRow = {
Id: string;
ItemId: string;
RpId: string;
@@ -21,7 +21,7 @@ export interface PasskeyRow {
/**
* Extended passkey row with item information.
*/
-export interface PasskeyWithItemRow extends PasskeyRow {
+export type PasskeyWithItemRow = PasskeyRow & {
Username?: string | null;
ServiceName?: string | null;
}
diff --git a/apps/browser-extension/src/utils/db/queries/ItemQueries.ts b/apps/browser-extension/src/utils/db/queries/ItemQueries.ts
index 0fafbae9b..712eb5601 100644
--- a/apps/browser-extension/src/utils/db/queries/ItemQueries.ts
+++ b/apps/browser-extension/src/utils/db/queries/ItemQueries.ts
@@ -1,5 +1,3 @@
-import { FieldKey } from '@/utils/dist/core/models/vault';
-
/**
* SQL query constants for Item operations.
* Centralizes all item-related queries to avoid duplication.
diff --git a/apps/browser-extension/src/utils/db/repositories/FolderRepository.ts b/apps/browser-extension/src/utils/db/repositories/FolderRepository.ts
index 095739adb..0b93578b0 100644
--- a/apps/browser-extension/src/utils/db/repositories/FolderRepository.ts
+++ b/apps/browser-extension/src/utils/db/repositories/FolderRepository.ts
@@ -3,7 +3,7 @@ import { BaseRepository } from '../BaseRepository';
/**
* Folder entity type.
*/
-export interface Folder {
+export type Folder = {
Id: string;
Name: string;
ParentFolderId: string | null;
diff --git a/apps/browser-extension/src/utils/db/repositories/ItemRepository.ts b/apps/browser-extension/src/utils/db/repositories/ItemRepository.ts
index 3dbf33116..d87679a69 100644
--- a/apps/browser-extension/src/utils/db/repositories/ItemRepository.ts
+++ b/apps/browser-extension/src/utils/db/repositories/ItemRepository.ts
@@ -10,6 +10,7 @@ import {
FieldDefinitionQueries,
FieldHistoryQueries
} from '../queries/ItemQueries';
+
import type { LogoRepository } from './LogoRepository';
/**
@@ -17,7 +18,12 @@ import type { LogoRepository } from './LogoRepository';
* Handles items, field values, field definitions, and field history.
*/
export class ItemRepository extends BaseRepository {
- constructor(
+ /**
+ * Constructor for the ItemRepository class.
+ * @param client - The database client to use for the repository
+ * @param logoRepository - The logo repository to use for the repository
+ */
+ protected constructor(
client: IDatabaseClient,
private logoRepository: LogoRepository
) {