Skip to content

Commit 1eb11b9

Browse files
committed
Format code with biome
1 parent 53ceb8d commit 1eb11b9

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

src/Client.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { readFileSync } from 'fs';
1+
import { readFileSync } from 'node:fs';
22
import { vi, beforeEach, describe, expect, it, afterEach } from 'vitest';
33
import type { MockResponseInitFunction } from 'vitest-fetch-mock';
44
import createFetchMock from 'vitest-fetch-mock';

src/api/DeferredJobsApiClient.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ function handleDeferredJob<V = any, P = any>(
4848
update(state.progress, state.value);
4949

5050
await sleep(JOB_STATUS_POLLING_INTERVAL);
51-
} while (true); // eslint-disable-line no-constant-condition
51+
// biome-ignore lint/correctness/noConstantCondition: <This infinite loop is expected and safe. There are two return statements breaking it when needed>
52+
} while (true);
5253
}
5354

5455
resolve(response.payload);

src/http/createRequest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ export async function createRequest<P = any>(
8585
if (!response.ok) {
8686
// Try to parse the response as JSON, if it contains any error messages
8787
// from backend. If not, fake the error message.
88-
let responsePayload;
88+
let responsePayload: undefined | ApiResponse<P>;
8989
try {
9090
responsePayload = await response.json();
91-
} catch (error) {
91+
} catch {
9292
responsePayload = createFakeErrorPayload(response);
9393
}
9494

src/types/Category.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ type WithNonEmptyTranslation<T extends Category, LocaleCode extends Culture['cod
114114
function isNonEmpty(
115115
translation: Category.Translation | undefined,
116116
): translation is NonEmptyTranslation {
117-
return Boolean(translation && translation.name && translation.slug);
117+
return Boolean(translation?.name && translation.slug);
118118
}
119119

120120
function localeCode(locale: LocaleIdentifier): Culture['code'] {

src/types/SortOrder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function toString(arg: SortOrder | SortOrder.Column | SortOrder.Direction): stri
120120
return `${toString(arg.direction)}${arg.name}`;
121121
}
122122

123-
function validateColumnName(name: string): void | never {
123+
function validateColumnName(name: string): undefined | never {
124124
if (name.length === 0) {
125125
throw new Error(`Invalid sort column name: '${name}'.`);
126126
}

0 commit comments

Comments
 (0)