From 8b70f497a1207e30edebdecd12b926c981c13d28 Mon Sep 17 00:00:00 2001 From: Synbulat Biishev Date: Thu, 19 Jan 2023 20:56:57 +0500 Subject: [PATCH] docs: fix version export (#9049) * docs: fix version export * types: assert `[VI]{{inject}}[/VI]` as string * types: typo * Revert "types: typo" This reverts commit ba983f02be2e365fd1e14838103531f7972c8ee2. * types: typo I hate my local repo. It can't install deps with `--immutable` and a have weird error on `yarn test`, but the CI passes --- packages/builders/src/index.ts | 3 +-- packages/collection/src/index.ts | 3 +-- packages/next/src/index.ts | 5 ++--- packages/rest/src/index.ts | 3 +-- packages/rest/src/lib/utils/constants.ts | 3 ++- packages/voice/src/index.ts | 3 +-- packages/ws/src/index.ts | 3 +-- packages/ws/src/utils/constants.ts | 2 +- 8 files changed, 10 insertions(+), 15 deletions(-) diff --git a/packages/builders/src/index.ts b/packages/builders/src/index.ts index f7d24e571..f021c022f 100644 --- a/packages/builders/src/index.ts +++ b/packages/builders/src/index.ts @@ -66,5 +66,4 @@ export * from '@discordjs/util'; * that you are currently using. */ // This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild -// eslint-disable-next-line @typescript-eslint/no-inferrable-types -export const version: string = '[VI]{{inject}}[/VI]'; +export const version = '[VI]{{inject}}[/VI]' as string; diff --git a/packages/collection/src/index.ts b/packages/collection/src/index.ts index df7a4cd31..501cd6827 100644 --- a/packages/collection/src/index.ts +++ b/packages/collection/src/index.ts @@ -5,5 +5,4 @@ export * from './collection.js'; * that you are currently using. */ // This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild -// eslint-disable-next-line @typescript-eslint/no-inferrable-types -export const version: string = '[VI]{{inject}}[/VI]'; +export const version = '[VI]{{inject}}[/VI]' as string; diff --git a/packages/next/src/index.ts b/packages/next/src/index.ts index e97dfbe8b..92ace86ea 100644 --- a/packages/next/src/index.ts +++ b/packages/next/src/index.ts @@ -1,7 +1,6 @@ /** - * The {@link https://github.com/discordjs/discord.js/blob/main/packages/discord.js-next/#readme | @discordjs/discord.js-next} version + * The {@link https://github.com/discordjs/discord.js/blob/main/packages/next/#readme | @discordjs/next} version * that you are currently using. */ // This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild -// eslint-disable-next-line @typescript-eslint/no-inferrable-types -export const version: string = '[VI]{{inject}}[/VI]'; +export const version = '[VI]{{inject}}[/VI]' as string; diff --git a/packages/rest/src/index.ts b/packages/rest/src/index.ts index 67945f24e..586580e61 100644 --- a/packages/rest/src/index.ts +++ b/packages/rest/src/index.ts @@ -12,5 +12,4 @@ export { makeURLSearchParams, parseResponse } from './lib/utils/utils.js'; * that you are currently using. */ // This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild -// eslint-disable-next-line @typescript-eslint/no-inferrable-types -export const version: string = '[VI]{{inject}}[/VI]'; +export const version = '[VI]{{inject}}[/VI]' as string; diff --git a/packages/rest/src/lib/utils/constants.ts b/packages/rest/src/lib/utils/constants.ts index 9a9c22c49..03381c70e 100644 --- a/packages/rest/src/lib/utils/constants.ts +++ b/packages/rest/src/lib/utils/constants.ts @@ -3,7 +3,8 @@ import { APIVersion } from 'discord-api-types/v10'; import { Agent } from 'undici'; import type { RESTOptions } from '../REST.js'; -export const DefaultUserAgent = `DiscordBot (https://discord.js.org, [VI]{{inject}}[/VI])`; +export const DefaultUserAgent = + `DiscordBot (https://discord.js.org, [VI]{{inject}}[/VI])` as `DiscordBot (https://discord.js.org, ${string})`; export const DefaultRestOptions = { get agent() { diff --git a/packages/voice/src/index.ts b/packages/voice/src/index.ts index b9a36f309..b1d8bf570 100644 --- a/packages/voice/src/index.ts +++ b/packages/voice/src/index.ts @@ -25,5 +25,4 @@ export { type JoinConfig, getVoiceConnection, getVoiceConnections, getGroups } f * that you are currently using. */ // This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild -// eslint-disable-next-line @typescript-eslint/no-inferrable-types -export const version: string = '[VI]{{inject}}[/VI]'; +export const version = '[VI]{{inject}}[/VI]' as string; diff --git a/packages/ws/src/index.ts b/packages/ws/src/index.ts index 1c1e05848..efeba21bd 100644 --- a/packages/ws/src/index.ts +++ b/packages/ws/src/index.ts @@ -18,5 +18,4 @@ export * from './ws/WebSocketShard.js'; * that you are currently using. */ // This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild -// eslint-disable-next-line @typescript-eslint/no-inferrable-types -export const version: string = '[VI]{{inject}}[/VI]'; +export const version = '[VI]{{inject}}[/VI]' as string; diff --git a/packages/ws/src/utils/constants.ts b/packages/ws/src/utils/constants.ts index 1d1457b68..eebeef201 100644 --- a/packages/ws/src/utils/constants.ts +++ b/packages/ws/src/utils/constants.ts @@ -19,7 +19,7 @@ export enum CompressionMethod { ZlibStream = 'zlib-stream', } -export const DefaultDeviceProperty = `@discordjs/ws [VI]{{inject}}[/VI]`; +export const DefaultDeviceProperty = `@discordjs/ws [VI]{{inject}}[/VI]` as `@discordjs/ws ${string}`; const getDefaultSessionStore = lazy(() => new Collection());