From 2798ba1eb3d734f0cf2eeccd2e16cfba6804873b Mon Sep 17 00:00:00 2001 From: Almeida Date: Thu, 12 Jan 2023 08:23:02 +0000 Subject: [PATCH] style: run prettier (#9041) --- .../mixins/ApplicationCommandOptionChannelTypesMixin.ts | 2 +- packages/discord.js/typings/index.d.ts | 4 ++-- packages/formatters/src/formatters.ts | 2 +- packages/rest/src/lib/utils/constants.ts | 6 +++--- .../strategy/WorkerContextFetchingStrategy.test.ts | 1 + .../ws/__tests__/strategy/WorkerShardingStrategy.test.ts | 1 + 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/builders/src/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.ts b/packages/builders/src/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.ts index cd022ec39210..a9125ac04e98 100644 --- a/packages/builders/src/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.ts +++ b/packages/builders/src/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.ts @@ -14,7 +14,7 @@ const allowedChannelTypes = [ ChannelType.GuildForum, ] as const; -export type ApplicationCommandOptionAllowedChannelTypes = typeof allowedChannelTypes[number]; +export type ApplicationCommandOptionAllowedChannelTypes = (typeof allowedChannelTypes)[number]; const channelTypesPredicate = s.array(s.union(...allowedChannelTypes.map((type) => s.literal(type)))); diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 15ab44e9b594..4af5472699ae 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -4620,8 +4620,8 @@ export type CacheConstructors = { // Narrowing the type of `manager.name` doesn't propagate type information to `holds` and the return type. export type CacheFactory = ( manager: CacheConstructors[keyof Caches], - holds: Caches[typeof manager['name']][1], -) => typeof manager['prototype'] extends DataManager ? Collection : never; + holds: Caches[(typeof manager)['name']][1], +) => (typeof manager)['prototype'] extends DataManager ? Collection : never; export type CacheWithLimitsOptions = { [K in keyof Caches]?: Caches[K][0]['prototype'] extends DataManager diff --git a/packages/formatters/src/formatters.ts b/packages/formatters/src/formatters.ts index 0fe1eb4030c3..cd830764d488 100644 --- a/packages/formatters/src/formatters.ts +++ b/packages/formatters/src/formatters.ts @@ -420,7 +420,7 @@ export const TimestampStyles = { /** * The possible values, see {@link TimestampStyles} for more information */ -export type TimestampStylesString = typeof TimestampStyles[keyof typeof TimestampStyles]; +export type TimestampStylesString = (typeof TimestampStyles)[keyof typeof TimestampStyles]; /** * An enum with all the available faces from Discord's native slash commands diff --git a/packages/rest/src/lib/utils/constants.ts b/packages/rest/src/lib/utils/constants.ts index 2285a4b4c6eb..21a0d30fa87c 100644 --- a/packages/rest/src/lib/utils/constants.ts +++ b/packages/rest/src/lib/utils/constants.ts @@ -46,9 +46,9 @@ export const ALLOWED_EXTENSIONS = ['webp', 'png', 'jpg', 'jpeg', 'gif'] as const export const ALLOWED_STICKER_EXTENSIONS = ['png', 'json'] as const satisfies readonly string[]; export const ALLOWED_SIZES = [16, 32, 64, 128, 256, 512, 1_024, 2_048, 4_096] as const satisfies readonly number[]; -export type ImageExtension = typeof ALLOWED_EXTENSIONS[number]; -export type StickerExtension = typeof ALLOWED_STICKER_EXTENSIONS[number]; -export type ImageSize = typeof ALLOWED_SIZES[number]; +export type ImageExtension = (typeof ALLOWED_EXTENSIONS)[number]; +export type StickerExtension = (typeof ALLOWED_STICKER_EXTENSIONS)[number]; +export type ImageSize = (typeof ALLOWED_SIZES)[number]; export const OverwrittenMimeTypes = { // https://github.com/discordjs/discord.js/issues/8557 diff --git a/packages/ws/__tests__/strategy/WorkerContextFetchingStrategy.test.ts b/packages/ws/__tests__/strategy/WorkerContextFetchingStrategy.test.ts index 7ce3de334ebc..643d66996485 100644 --- a/packages/ws/__tests__/strategy/WorkerContextFetchingStrategy.test.ts +++ b/packages/ws/__tests__/strategy/WorkerContextFetchingStrategy.test.ts @@ -46,6 +46,7 @@ vi.mock('node:worker_threads', async () => { return { parentPort: new MockParentPort(), isMainThread: false, + workerData: {}, }; }); diff --git a/packages/ws/__tests__/strategy/WorkerShardingStrategy.test.ts b/packages/ws/__tests__/strategy/WorkerShardingStrategy.test.ts index 474de313aa59..3aacd3733b3c 100644 --- a/packages/ws/__tests__/strategy/WorkerShardingStrategy.test.ts +++ b/packages/ws/__tests__/strategy/WorkerShardingStrategy.test.ts @@ -135,6 +135,7 @@ vi.mock('node:worker_threads', async () => { return { Worker: MockWorker, + workerData: {}, }; });