From af79356e58355d87aa73ae5258a231a4c89d70be Mon Sep 17 00:00:00 2001 From: Bruno Miiller Date: Tue, 19 May 2026 23:07:36 -0300 Subject: [PATCH] Apply biome format and lint fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - pro/src/account.ts: cast parens (}) as T; biome-ignore on intentional unreachable code after fake-license shortcut - pro/src/fsGoogleDrive.ts: let → const; missing semicolon; == → === (mimeType comparison and parent lookup) - src/misc.ts: line break on long b.buffer.slice() chain --- pro/src/account.ts | 3 ++- pro/src/fsGoogleDrive.ts | 8 ++++---- src/misc.ts | 5 ++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pro/src/account.ts b/pro/src/account.ts index b21c5e3..0702c1c 100644 --- a/pro/src/account.ts +++ b/pro/src/account.ts @@ -191,13 +191,14 @@ export const getAndSaveProFeatures = async ( featureName: i, enableAtTimeMs: 1e12, expireAtTimeMs: 3e12, - } as FeatureInfo) + }) as FeatureInfo ), }; config.enabledProFeatures = res.proFeatures; await saveUpdatedConfigFunc?.(); return res; + // biome-ignore lint/correctness/noUnreachable: original upstream flow kept for reference (the fake-license shortcut above is intentional) const access = await getAccessToken(config, saveUpdatedConfigFunc); const resp1 = await fetch(`${site}/api/v1/pro/list`, { diff --git a/pro/src/fsGoogleDrive.ts b/pro/src/fsGoogleDrive.ts index 227da10..7e8ba6d 100644 --- a/pro/src/fsGoogleDrive.ts +++ b/pro/src/fsGoogleDrive.ts @@ -358,7 +358,7 @@ export class FakeFsGoogleDrive extends FakeFs { } while (nextPageToken !== undefined); const allFolderRes = allFileRes.filter( - (i) => i.mimeType == FOLDER_MIME_TYPE + (i) => i.mimeType === FOLDER_MIME_TYPE ); const allFolders = [ @@ -368,7 +368,7 @@ export class FakeFsGoogleDrive extends FakeFs { }, ]; - for (let targetFolder of allFolders) { + for (const targetFolder of allFolders) { allFolderRes .filter((i) => i.parents?.includes(targetFolder.id)) .forEach((i) => { @@ -384,7 +384,7 @@ export class FakeFsGoogleDrive extends FakeFs { for (const file of allFileRes) { if (!file.parents) continue; file.parents.forEach((parent) => { - const folder = allFolders.find((folder) => folder.id == parent); + const folder = allFolders.find((folder) => folder.id === parent); if (!folder) return; const entity = fromFileToGDEntity(file, folder.id, folder.folderPath); allFiles.push(entity); @@ -600,7 +600,7 @@ export class FakeFsGoogleDrive extends FakeFs { modifiedTime: unixTimeToStr(mtime, true), createdTime: unixTimeToStr(ctime, true), }; - if(!targetFileId) meta.parents = [parentID] + if (!targetFileId) meta.parents = [parentID]; if (content.byteLength <= 5 * 1024 * 1024) { const formData = new FormData(); diff --git a/src/misc.ts b/src/misc.ts index 4e21266..428f109 100644 --- a/src/misc.ts +++ b/src/misc.ts @@ -90,7 +90,10 @@ export const mkdirpInVault = async (thePath: string, vault: Vault) => { export const bufferToArrayBuffer = ( b: Buffer | Uint8Array | ArrayBufferView ) => { - return b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength) as ArrayBuffer; + return b.buffer.slice( + b.byteOffset, + b.byteOffset + b.byteLength + ) as ArrayBuffer; }; /**