Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

fix(repo): make the workspace lint, typecheck and test clean (#1978)

Hampusf00468542409
diff --git a/biome.json b/biome.json
index ac054ad7a..ca4905183 100644
--- a/biome.json
+++ b/biome.json
@@ -145,7 +145,14 @@
"!fluxer_static",
"!packages/fonts",
"!fluxer_admin/static/htmx.min.js",
- "!fluxer_api/src/api/openapi/openapi.json"
+ "!fluxer_api/src/api/openapi/openapi.json",
+ "!fluxer_api/pkgs/email/src/email_i18n/locales",
+ "!fluxer_api/pkgs/email/src/email_i18n/weblate",
+ "!fluxer_api/src/api/content_i18n/locales",
+ "!fluxer_api/src/api/content_i18n/weblate",
+ "!packages/errors/src/i18n/locales",
+ "!packages/errors/src/i18n/weblate",
+ "!**/auto-i18n-reviewed-unchanged.json"
],
"ignoreUnknown": true
}
diff --git a/fluxer_api/src/api/infrastructure/StorageService.ts b/fluxer_api/src/api/infrastructure/StorageService.ts
index f91547290..686d3ba40 100644
--- a/fluxer_api/src/api/infrastructure/StorageService.ts
+++ b/fluxer_api/src/api/infrastructure/StorageService.ts
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-import type {S3ProviderSettings} from '@fluxer/config/src/S3DownloadsProvider';
import assert from 'node:assert/strict';
import {createHash} from 'node:crypto';
import fs from 'node:fs';
@@ -27,6 +26,7 @@ import {
} from '@aws-sdk/client-s3';
import {Upload} from '@aws-sdk/lib-storage';
import {getSignedUrl} from '@aws-sdk/s3-request-presigner';
+import type {S3ProviderSettings} from '@fluxer/config/src/S3DownloadsProvider';
import {isSupportedMediaContentType} from '@pkgs/mime_utils/src/ContentTypeUtils';
import {seconds} from 'itty-time';
import {temporaryFile} from 'tempy';
diff --git a/fluxer_api/src/api/user/services/UserAccountSecurityService.ts b/fluxer_api/src/api/user/services/UserAccountSecurityService.ts
index cb91564ae..70c1a0562 100644
--- a/fluxer_api/src/api/user/services/UserAccountSecurityService.ts
+++ b/fluxer_api/src/api/user/services/UserAccountSecurityService.ts
@@ -8,11 +8,11 @@ import {InputValidationError} from '@fluxer/errors/src/domains/core/InputValidat
import type {UserUpdateRequest} from '@fluxer/schema/src/domains/user/UserRequestSchemas';
import type {IRateLimitService} from '@pkgs/rate_limit/src/IRateLimitService';
import type {ApiContext} from '../../ApiContext';
-import {Config} from '../../Config';
import * as AuthPassword from '../../auth/AuthPassword';
import * as AuthSession from '../../auth/AuthSession';
import type {SudoVerificationResult} from '../../auth/services/SudoVerificationService';
import {deriveSudoMethods, userHasMfa} from '../../auth/services/SudoVerificationService';
+import {Config} from '../../Config';
import type {UserRow} from '../../database/types/UserTypes';
import type {IDiscriminatorService} from '../../infrastructure/DiscriminatorService';
import type {LimitConfigService} from '../../limits/LimitConfigService';
diff --git a/fluxer_api/src/api/user/services/UserChannelService.ts b/fluxer_api/src/api/user/services/UserChannelService.ts
index abed71305..73f4647fc 100644
--- a/fluxer_api/src/api/user/services/UserChannelService.ts
+++ b/fluxer_api/src/api/user/services/UserChannelService.ts
@@ -23,7 +23,6 @@ import {requireEmailVerified} from '../../auth/EmailVerificationUtils';
import type {ChannelID, UserID} from '../../BrandedTypes';
import {createChannelID, createMessageID, createUserID} from '../../BrandedTypes';
import {mapChannelToResponse} from '../../channel/ChannelMappers';
-import {SYSTEM_USER_ID} from '../../constants/Core';
import type {IChannelRepository} from '../../channel/IChannelRepository';
import type {ChannelService} from '../../channel/services/ChannelService';
import {dispatchMessageCreateBroadcast} from '../../channel/services/message/MessageGatewayDispatch';
@@ -31,6 +30,7 @@ import {
createMessageResponseDataService,
messageResponseAccessForGuild,
} from '../../channel/services/message/MessageResponseDataService';
+import {SYSTEM_USER_ID} from '../../constants/Core';
import type {IGatewayService} from '../../infrastructure/IGatewayService';
import type {ISnowflakeService} from '../../infrastructure/ISnowflakeService';
import type {UserCacheService} from '../../infrastructure/UserCacheService';
diff --git a/fluxer_api/src/api/user/tests/UserChannelService.test.ts b/fluxer_api/src/api/user/tests/UserChannelService.test.ts
index 8bb522025..7c1cb8949 100644
--- a/fluxer_api/src/api/user/tests/UserChannelService.test.ts
+++ b/fluxer_api/src/api/user/tests/UserChannelService.test.ts
@@ -5,6 +5,7 @@ import {ChannelTypes} from '@fluxer/constants/src/ChannelConstants';
import {UserFlags} from '@fluxer/constants/src/UserConstants';
import {afterAll, beforeAll, beforeEach, describe, expect, test} from 'vitest';
import {createTestAccount, unclaimAccount} from '../../auth/tests/AuthTestUtils';
+import {createChannelID, createUserID} from '../../BrandedTypes';
import {authorizeBot, createTestBotAccount} from '../../bot/tests/BotTestUtils';
import {
acceptInvite,
@@ -19,13 +20,12 @@ import {
type MinimalChannelResponse,
sendChannelMessage,
} from '../../channel/tests/ChannelTestUtils';
-import {createChannelID, createUserID} from '../../BrandedTypes';
import {SYSTEM_USER_ID} from '../../constants/Core';
-import {UserRepository} from '../../user/repositories/UserRepository';
import {ensureSessionStarted} from '../../message/tests/MessageTestUtils';
import {type ApiTestHarness, createApiTestHarness} from '../../test/ApiTestHarness';
import {HTTP_STATUS} from '../../test/TestConstants';
import {createBuilder} from '../../test/TestRequestBuilder';
+import {UserRepository} from '../../user/repositories/UserRepository';
interface PrivateChannelsResponse extends Array<MinimalChannelResponse> {}
diff --git a/fluxer_app/src/features/voice/engine/VoiceMediaGraphSimulation.test.ts b/fluxer_app/src/features/voice/engine/VoiceMediaGraphSimulation.test.ts
index ba4a7ee97..d5e675a00 100644
--- a/fluxer_app/src/features/voice/engine/VoiceMediaGraphSimulation.test.ts
+++ b/fluxer_app/src/features/voice/engine/VoiceMediaGraphSimulation.test.ts
@@ -670,5 +670,5 @@ describe('VoiceMediaGraphSimulation', () => {
const second = runSimulation(seed);
expect(second, `seed=${seed} replay diverged`).toEqual(first);
}
- });
+ }, 60_000);
});
diff --git a/fluxer_desktop/scripts/build.mjs b/fluxer_desktop/scripts/build.mjs
index 66a10cd40..0f509ed14 100644
--- a/fluxer_desktop/scripts/build.mjs
+++ b/fluxer_desktop/scripts/build.mjs
@@ -135,7 +135,14 @@ function addFilesFromDirectory(files, packageDir, relativeDir, predicate) {
function collectRuntimeArtifactPaths(packageDir) {
const artifacts = new Set();
- for (const fileName of ['index.js', 'index.d.ts', 'binding.js', 'binding.d.ts', 'loader-diagnostics.cjs', 'pure.cjs']) {
+ for (const fileName of [
+ 'index.js',
+ 'index.d.ts',
+ 'binding.js',
+ 'binding.d.ts',
+ 'loader-diagnostics.cjs',
+ 'pure.cjs',
+ ]) {
if (fs.existsSync(path.join(packageDir, fileName))) {
artifacts.add(fileName);
}
diff --git a/packages/schema/src/domains/admin/AdminGuildSchemas.ts b/packages/schema/src/domains/admin/AdminGuildSchemas.ts
index cfa8cd5c8..d4174d877 100644
--- a/packages/schema/src/domains/admin/AdminGuildSchemas.ts
+++ b/packages/schema/src/domains/admin/AdminGuildSchemas.ts
@@ -48,10 +48,10 @@ export const GuildAdminResponse = z.object({
.optional()
.describe('Custom content warning text shown before entry'),
approximate_member_count: Int32Type.optional().describe(
- 'Approximate total member count (only when with_counts is true)'
+ 'Approximate total member count (only when with_counts is true)',
),
approximate_presence_count: Int32Type.optional().describe(
- 'Approximate online member count (only when with_counts is true)'
+ 'Approximate online member count (only when with_counts is true)',
),
});
diff --git a/packages/schema/src/domains/admin/AdminUserSchemas.ts b/packages/schema/src/domains/admin/AdminUserSchemas.ts
index 1c0625cf1..39726cfb9 100644
--- a/packages/schema/src/domains/admin/AdminUserSchemas.ts
+++ b/packages/schema/src/domains/admin/AdminUserSchemas.ts
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
+import {AdminACLs} from '@fluxer/constants/src/AdminACLs';
import {
PremiumFlags,
PremiumFlagsDescriptions,
@@ -8,7 +9,6 @@ import {
UserFlags,
UserFlagsDescriptions,
} from '@fluxer/constants/src/UserConstants';
-import {AdminACLs} from '@fluxer/constants/src/AdminACLs';
import {NSFWLevelSchema} from '@fluxer/schema/src/primitives/GuildValidators';
import {
createBitflagInt32Type,
diff --git a/packages/schema/src/domains/gif/GifMediaFormatKeys.ts b/packages/schema/src/domains/gif/GifMediaFormatKeys.ts
index e419b9d65..d21db6494 100644
--- a/packages/schema/src/domains/gif/GifMediaFormatKeys.ts
+++ b/packages/schema/src/domains/gif/GifMediaFormatKeys.ts
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-export const FORMAT_CONTENT_TYPES: Record<string, string> = {
+const FORMAT_CONTENT_TYPES: Record<string, string> = {
gif: 'image/gif',
loopedmp4: 'video/mp4',
mediumgif: 'image/gif',
diff --git a/packages/schema/src/domains/tests/AttachmentSizeSchemas.test.ts b/packages/schema/src/domains/tests/AttachmentSizeSchemas.test.ts
index 630a4c3b6..974e79693 100644
--- a/packages/schema/src/domains/tests/AttachmentSizeSchemas.test.ts
+++ b/packages/schema/src/domains/tests/AttachmentSizeSchemas.test.ts
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
+import {ClientUploadedAttachmentRequest} from '@fluxer/schema/src/domains/message/AttachmentSchemas';
import {
PresignedAttachmentUploadRequest,
PresignedAttachmentUploadResponse,
} from '@fluxer/schema/src/domains/message/AttachmentUploadSchemas';
-import {ClientUploadedAttachmentRequest} from '@fluxer/schema/src/domains/message/AttachmentSchemas';
import {MessageAttachmentResponse} from '@fluxer/schema/src/domains/message/MessageResponseSchemas';
import {describe, expect, it} from 'vitest';