chore: enforce lint across codebase and ban "maybe" in identifiers
Remove member-ordering and complexity eslint-disable comments by reordering class members and applying targeted fixes. Add metoyou/no-maybe-in-naming, type-safe WebRTC e2e harness helpers, and resolve remaining lint errors so npm run lint exits cleanly. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -27,17 +27,21 @@ interface StoredFileRecord {
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class BrowserAttachmentFileStore implements AttachmentFileStore {
|
||||
readonly maxPersistableBytes = MAX_BROWSER_INLINE_MEDIA_SIZE_BYTES;
|
||||
readonly supportsStreamingToDisk = false;
|
||||
readonly supportsChunkedReads = true;
|
||||
readonly providesInlineObjectUrl = false;
|
||||
|
||||
private database: IDBDatabase | null = null;
|
||||
private activeDatabaseName: string | null = null;
|
||||
readonly supportsStreamingToDisk = false;
|
||||
|
||||
readonly supportsChunkedReads = true;
|
||||
|
||||
readonly providesInlineObjectUrl = false;
|
||||
|
||||
get isAvailable(): boolean {
|
||||
return typeof indexedDB !== 'undefined';
|
||||
}
|
||||
|
||||
private database: IDBDatabase | null = null;
|
||||
|
||||
private activeDatabaseName: string | null = null;
|
||||
|
||||
async getAppDataPath(): Promise<string | null> {
|
||||
return this.isAvailable ? BROWSER_APP_DATA_ROOT : null;
|
||||
}
|
||||
@@ -225,4 +229,5 @@ export class BrowserAttachmentFileStore implements AttachmentFileStore {
|
||||
transaction.onabort = () => reject(transaction.error);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,16 +16,19 @@ const CAPACITOR_APP_DATA_ROOT = 'metoyou';
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class CapacitorAttachmentFileStore implements AttachmentFileStore {
|
||||
readonly maxPersistableBytes = Number.POSITIVE_INFINITY;
|
||||
readonly supportsStreamingToDisk = true;
|
||||
readonly supportsChunkedReads = false;
|
||||
readonly providesInlineObjectUrl = true;
|
||||
|
||||
private readonly loadFilesystem: () => Promise<CapacitorAttachmentFilesystem | null> = loadCapacitorAttachmentFilesystem;
|
||||
readonly supportsStreamingToDisk = true;
|
||||
|
||||
readonly supportsChunkedReads = false;
|
||||
|
||||
readonly providesInlineObjectUrl = true;
|
||||
|
||||
get isAvailable(): boolean {
|
||||
return isCapacitorNativeRuntime();
|
||||
}
|
||||
|
||||
private readonly loadFilesystem: () => Promise<CapacitorAttachmentFilesystem | null> = loadCapacitorAttachmentFilesystem;
|
||||
|
||||
async getAppDataPath(): Promise<string | null> {
|
||||
return this.isAvailable ? CAPACITOR_APP_DATA_ROOT : null;
|
||||
}
|
||||
@@ -200,4 +203,5 @@ export class CapacitorAttachmentFileStore implements AttachmentFileStore {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,11 +6,12 @@ import type { AttachmentFileStore } from './attachment-file-store';
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class ElectronAttachmentFileStore implements AttachmentFileStore {
|
||||
readonly maxPersistableBytes = Number.POSITIVE_INFINITY;
|
||||
readonly supportsStreamingToDisk = true;
|
||||
readonly supportsChunkedReads = true;
|
||||
readonly providesInlineObjectUrl = false;
|
||||
|
||||
private readonly electronBridge = inject(ElectronBridgeService);
|
||||
readonly supportsStreamingToDisk = true;
|
||||
|
||||
readonly supportsChunkedReads = true;
|
||||
|
||||
readonly providesInlineObjectUrl = false;
|
||||
|
||||
get isAvailable(): boolean {
|
||||
const electronApi = this.electronBridge.getApi();
|
||||
@@ -18,6 +19,8 @@ export class ElectronAttachmentFileStore implements AttachmentFileStore {
|
||||
return !!electronApi?.appendFile && !!electronApi.writeFile && !!electronApi.getAppDataPath;
|
||||
}
|
||||
|
||||
private readonly electronBridge = inject(ElectronBridgeService);
|
||||
|
||||
async getAppDataPath(): Promise<string | null> {
|
||||
const electronApi = this.electronBridge.getApi();
|
||||
|
||||
@@ -169,4 +172,5 @@ export class ElectronAttachmentFileStore implements AttachmentFileStore {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user