Skip to content

Commit

Permalink
chore: make requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
suneettipirneni committed Sep 1, 2022
1 parent 2d2541d commit 1023f39
Show file tree
Hide file tree
Showing 75 changed files with 349 additions and 276 deletions.
3 changes: 1 addition & 2 deletions packages/actions/package.json
Expand Up @@ -48,8 +48,7 @@
"@typescript-eslint/parser": "^5.36.1",
"@vitest/coverage-c8": "^0.22.1",
"eslint": "^8.23.0",
"eslint-config-marine": "^9.4.1",
"eslint-config-neon": "^0.1.13",
"eslint-config-neon": "^0.1.22",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^3.5.0",
"eslint-plugin-import": "^2.26.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/api-extractor-utils/package.json
Expand Up @@ -38,8 +38,7 @@
"@typescript-eslint/eslint-plugin": "^5.36.1",
"@typescript-eslint/parser": "^5.36.1",
"eslint": "^8.23.0",
"eslint-config-marine": "^9.4.1",
"eslint-config-neon": "^0.1.13",
"eslint-config-neon": "^0.1.22",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^3.5.0",
"eslint-plugin-import": "^2.26.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/api-extractor-utils/src/tsdoc/index.ts
Expand Up @@ -13,8 +13,7 @@ import {
} from '@microsoft/tsdoc';
import { block } from './CommentBlock.js';
import { codeSpan } from './CommentCodeSpan.js';
import type { AnyDocNodeJSON } from './CommentNode';
import { node as _node } from './CommentNode.js';
import { node as _node, type AnyDocNodeJSON } from './CommentNode.js';
import { nodeContainer } from './CommentNodeContainer.js';
import { fencedCode } from './FencedCodeCommentNode.js';
import { linkTagNode } from './LinkTagCommentNode.js';
Expand Down
8 changes: 6 additions & 2 deletions packages/builders/__tests__/components/actionRow.test.ts
@@ -1,5 +1,9 @@
import type { APIActionRowComponent, APIMessageActionRowComponent } from 'discord-api-types/v10';
import { ButtonStyle, ComponentType } from 'discord-api-types/v10';
import {
ButtonStyle,
ComponentType,
type APIActionRowComponent,
type APIMessageActionRowComponent,
} from 'discord-api-types/v10';
import { describe, test, expect } from 'vitest';
import {
ActionRowBuilder,
Expand Down
8 changes: 6 additions & 2 deletions packages/builders/__tests__/components/button.test.ts
@@ -1,6 +1,10 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
import type { APIButtonComponentWithCustomId, APIButtonComponentWithURL } from 'discord-api-types/v10';
import { ButtonStyle, ComponentType } from 'discord-api-types/v10';
import {
ButtonStyle,
ComponentType,
type APIButtonComponentWithCustomId,
type APIButtonComponentWithURL,
} from 'discord-api-types/v10';
import { describe, test, expect } from 'vitest';
import { buttonLabelValidator, buttonStyleValidator } from '../../src/components/Assertions.js';
import { ButtonBuilder } from '../../src/components/button/Button.js';
Expand Down
16 changes: 9 additions & 7 deletions packages/builders/__tests__/components/components.test.ts
@@ -1,11 +1,13 @@
import type {
APIActionRowComponent,
APIButtonComponent,
APIMessageActionRowComponent,
APISelectMenuComponent,
APITextInputComponent,
import {
ButtonStyle,
ComponentType,
TextInputStyle,
type APIButtonComponent,
type APIMessageActionRowComponent,
type APISelectMenuComponent,
type APITextInputComponent,
type APIActionRowComponent,
} from 'discord-api-types/v10';
import { ButtonStyle, ComponentType, TextInputStyle } from 'discord-api-types/v10';
import { describe, test, expect } from 'vitest';
import {
ActionRowBuilder,
Expand Down
3 changes: 1 addition & 2 deletions packages/builders/__tests__/components/selectMenu.test.ts
@@ -1,6 +1,5 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
import type { APISelectMenuComponent, APISelectMenuOption } from 'discord-api-types/v10';
import { ComponentType } from 'discord-api-types/v10';
import { ComponentType, type APISelectMenuComponent, type APISelectMenuOption } from 'discord-api-types/v10';
import { describe, test, expect } from 'vitest';
import { SelectMenuBuilder, SelectMenuOptionBuilder } from '../../src/index.js';

Expand Down
3 changes: 1 addition & 2 deletions packages/builders/__tests__/components/textInput.test.ts
@@ -1,5 +1,4 @@
import type { APITextInputComponent } from 'discord-api-types/v10';
import { ComponentType, TextInputStyle } from 'discord-api-types/v10';
import { ComponentType, TextInputStyle, type APITextInputComponent } from 'discord-api-types/v10';
import { describe, test, expect } from 'vitest';
import {
labelValidator,
Expand Down
@@ -1,15 +1,16 @@
import type {
APIApplicationCommandAttachmentOption,
APIApplicationCommandBooleanOption,
APIApplicationCommandChannelOption,
APIApplicationCommandIntegerOption,
APIApplicationCommandMentionableOption,
APIApplicationCommandNumberOption,
APIApplicationCommandRoleOption,
APIApplicationCommandStringOption,
APIApplicationCommandUserOption,
import {
ApplicationCommandOptionType,
ChannelType,
type APIApplicationCommandAttachmentOption,
type APIApplicationCommandBooleanOption,
type APIApplicationCommandChannelOption,
type APIApplicationCommandIntegerOption,
type APIApplicationCommandMentionableOption,
type APIApplicationCommandNumberOption,
type APIApplicationCommandRoleOption,
type APIApplicationCommandStringOption,
type APIApplicationCommandUserOption,
} from 'discord-api-types/v10';
import { ApplicationCommandOptionType, ChannelType } from 'discord-api-types/v10';
import { describe, test, expect } from 'vitest';
import {
SlashCommandAttachmentOption,
Expand Down
@@ -1,6 +1,5 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
import type { APIApplicationCommandOptionChoice } from 'discord-api-types/v10';
import { ChannelType, PermissionFlagsBits } from 'discord-api-types/v10';
import { ChannelType, PermissionFlagsBits, type APIApplicationCommandOptionChoice } from 'discord-api-types/v10';
import { describe, test, expect } from 'vitest';
import {
SlashCommandAssertions,
Expand Down
17 changes: 13 additions & 4 deletions packages/builders/__tests__/interactions/modal.test.ts
@@ -1,9 +1,18 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
import type { APIModalInteractionResponseCallbackData, APITextInputComponent } from 'discord-api-types/v10';
import { ComponentType, TextInputStyle } from 'discord-api-types/v10';
import {
ComponentType,
TextInputStyle,
type APIModalInteractionResponseCallbackData,
type APITextInputComponent,
} from 'discord-api-types/v10';
import { describe, test, expect } from 'vitest';
import type { ModalActionRowComponentBuilder } from '../../src';
import { ActionRowBuilder, ButtonBuilder, ModalBuilder, TextInputBuilder } from '../../src/index.js';
import {
ActionRowBuilder,
ButtonBuilder,
ModalBuilder,
TextInputBuilder,
type ModalActionRowComponentBuilder,
} from '../../src/index.js';
import {
componentsValidator,
titleValidator,
Expand Down
3 changes: 1 addition & 2 deletions packages/builders/package.json
Expand Up @@ -70,8 +70,7 @@
"@vitest/coverage-c8": "^0.22.1",
"downlevel-dts": "^0.10.1",
"eslint": "^8.23.0",
"eslint-config-marine": "^9.4.1",
"eslint-config-neon": "^0.1.13",
"eslint-config-neon": "^0.1.22",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^3.5.0",
"eslint-plugin-import": "^2.26.0",
Expand Down
11 changes: 6 additions & 5 deletions packages/builders/src/components/ActionRow.ts
@@ -1,9 +1,10 @@
import type {
APIMessageActionRowComponent,
APIModalActionRowComponent,
APIActionRowComponentTypes,
import {
type APIActionRowComponent,
ComponentType,
type APIMessageActionRowComponent,
type APIModalActionRowComponent,
type APIActionRowComponentTypes,
} from 'discord-api-types/v10';
import { type APIActionRowComponent, ComponentType } from 'discord-api-types/v10';
import { normalizeArray, type RestOrArray } from '../util/normalizeArray.js';
import { ComponentBuilder } from './Component.js';
import { createComponentBuilder } from './Components.js';
Expand Down
3 changes: 1 addition & 2 deletions packages/builders/src/components/Assertions.ts
@@ -1,6 +1,5 @@
import { s } from '@sapphire/shapeshift';
import type { APIMessageComponentEmoji } from 'discord-api-types/v10';
import { ButtonStyle } from 'discord-api-types/v10';
import { ButtonStyle, type APIMessageComponentEmoji } from 'discord-api-types/v10';
import { isValidationEnabled } from '../util/validation.js';
import { SelectMenuOptionBuilder } from './selectMenu/SelectMenuOption.js';

Expand Down
3 changes: 1 addition & 2 deletions packages/builders/src/components/Components.ts
@@ -1,5 +1,4 @@
import type { APIMessageComponent, APIModalComponent } from 'discord-api-types/v10';
import { ComponentType } from 'discord-api-types/v10';
import { ComponentType, type APIMessageComponent, type APIModalComponent } from 'discord-api-types/v10';
import {
ActionRowBuilder,
type AnyComponentBuilder,
Expand Down
2 changes: 1 addition & 1 deletion packages/builders/src/components/button/Button.ts
@@ -1,10 +1,10 @@
import type { ButtonStyle } from 'discord-api-types/v10';
import {
ComponentType,
type APIMessageComponentEmoji,
type APIButtonComponent,
type APIButtonComponentWithURL,
type APIButtonComponentWithCustomId,
type ButtonStyle,
} from 'discord-api-types/v10';
import {
buttonLabelValidator,
Expand Down
3 changes: 1 addition & 2 deletions packages/builders/src/components/selectMenu/SelectMenu.ts
@@ -1,5 +1,4 @@
import type { APISelectMenuOption } from 'discord-api-types/v10';
import { ComponentType, type APISelectMenuComponent } from 'discord-api-types/v10';
import { ComponentType, type APISelectMenuComponent, type APISelectMenuOption } from 'discord-api-types/v10';
import { normalizeArray, type RestOrArray } from '../../util/normalizeArray.js';
import {
customIdValidator,
Expand Down
@@ -1,6 +1,5 @@
import { s } from '@sapphire/shapeshift';
import type { LocalizationMap } from 'discord-api-types/v10';
import { type APIApplicationCommandOptionChoice, Locale } from 'discord-api-types/v10';
import { type APIApplicationCommandOptionChoice, Locale, type LocalizationMap } from 'discord-api-types/v10';
import { isValidationEnabled } from '../../util/validation.js';
import type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder';
import type { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands';
Expand Down
@@ -1,8 +1,9 @@
import type {
APIApplicationCommandSubcommandGroupOption,
APIApplicationCommandSubcommandOption,
import type {} from 'discord-api-types/v10';
import {
ApplicationCommandOptionType,
type APIApplicationCommandSubcommandGroupOption,
type APIApplicationCommandSubcommandOption,
} from 'discord-api-types/v10';
import { ApplicationCommandOptionType } from 'discord-api-types/v10';
import { mix } from 'ts-mixer';
import { assertReturnOfBuilder, validateMaxOptionsLength, validateRequiredParameters } from './Assertions.js';
import type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder.js';
Expand Down
@@ -1,6 +1,5 @@
import { s } from '@sapphire/shapeshift';
import type { APIApplicationCommandOptionChoice } from 'discord-api-types/v10';
import { ApplicationCommandOptionType } from 'discord-api-types/v10';
import { ApplicationCommandOptionType, type APIApplicationCommandOptionChoice } from 'discord-api-types/v10';
import { localizationMapPredicate, validateChoicesLength } from '../Assertions.js';

const stringPredicate = s.string.lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100);
Expand Down
@@ -1,5 +1,4 @@
import type { APIApplicationCommandAttachmentOption } from 'discord-api-types/v10';
import { ApplicationCommandOptionType } from 'discord-api-types/v10';
import { ApplicationCommandOptionType, type APIApplicationCommandAttachmentOption } from 'discord-api-types/v10';
import { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase.js';

export class SlashCommandAttachmentOption extends ApplicationCommandOptionBase {
Expand Down
@@ -1,5 +1,4 @@
import type { APIApplicationCommandBooleanOption } from 'discord-api-types/v10';
import { ApplicationCommandOptionType } from 'discord-api-types/v10';
import { ApplicationCommandOptionType, type APIApplicationCommandBooleanOption } from 'discord-api-types/v10';
import { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase.js';

export class SlashCommandBooleanOption extends ApplicationCommandOptionBase {
Expand Down
@@ -1,5 +1,4 @@
import type { APIApplicationCommandChannelOption } from 'discord-api-types/v10';
import { ApplicationCommandOptionType } from 'discord-api-types/v10';
import { ApplicationCommandOptionType, type APIApplicationCommandChannelOption } from 'discord-api-types/v10';
import { mix } from 'ts-mixer';
import { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase.js';
import { ApplicationCommandOptionChannelTypesMixin } from '../mixins/ApplicationCommandOptionChannelTypesMixin.js';
Expand Down
@@ -1,6 +1,5 @@
import { s } from '@sapphire/shapeshift';
import type { APIApplicationCommandIntegerOption } from 'discord-api-types/v10';
import { ApplicationCommandOptionType } from 'discord-api-types/v10';
import { ApplicationCommandOptionType, type APIApplicationCommandIntegerOption } from 'discord-api-types/v10';
import { mix } from 'ts-mixer';
import { ApplicationCommandNumericOptionMinMaxValueMixin } from '../mixins/ApplicationCommandNumericOptionMinMaxValueMixin.js';
import { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase.js';
Expand Down
@@ -1,5 +1,4 @@
import type { APIApplicationCommandMentionableOption } from 'discord-api-types/v10';
import { ApplicationCommandOptionType } from 'discord-api-types/v10';
import { ApplicationCommandOptionType, type APIApplicationCommandMentionableOption } from 'discord-api-types/v10';
import { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase.js';

export class SlashCommandMentionableOption extends ApplicationCommandOptionBase {
Expand Down
@@ -1,6 +1,5 @@
import { s } from '@sapphire/shapeshift';
import type { APIApplicationCommandNumberOption } from 'discord-api-types/v10';
import { ApplicationCommandOptionType } from 'discord-api-types/v10';
import { ApplicationCommandOptionType, type APIApplicationCommandNumberOption } from 'discord-api-types/v10';
import { mix } from 'ts-mixer';
import { ApplicationCommandNumericOptionMinMaxValueMixin } from '../mixins/ApplicationCommandNumericOptionMinMaxValueMixin.js';
import { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase.js';
Expand Down
@@ -1,5 +1,4 @@
import type { APIApplicationCommandRoleOption } from 'discord-api-types/v10';
import { ApplicationCommandOptionType } from 'discord-api-types/v10';
import { ApplicationCommandOptionType, type APIApplicationCommandRoleOption } from 'discord-api-types/v10';
import { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase.js';

export class SlashCommandRoleOption extends ApplicationCommandOptionBase {
Expand Down
@@ -1,6 +1,5 @@
import { s } from '@sapphire/shapeshift';
import type { APIApplicationCommandStringOption } from 'discord-api-types/v10';
import { ApplicationCommandOptionType } from 'discord-api-types/v10';
import { ApplicationCommandOptionType, type APIApplicationCommandStringOption } from 'discord-api-types/v10';
import { mix } from 'ts-mixer';
import { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase.js';
import { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.js';
Expand Down
@@ -1,5 +1,4 @@
import type { APIApplicationCommandUserOption } from 'discord-api-types/v10';
import { ApplicationCommandOptionType } from 'discord-api-types/v10';
import { ApplicationCommandOptionType, type APIApplicationCommandUserOption } from 'discord-api-types/v10';
import { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase.js';

export class SlashCommandUserOption extends ApplicationCommandOptionBase {
Expand Down
3 changes: 1 addition & 2 deletions packages/collection/package.json
Expand Up @@ -59,8 +59,7 @@
"@vitest/coverage-c8": "^0.22.1",
"downlevel-dts": "^0.10.1",
"eslint": "^8.23.0",
"eslint-config-marine": "^9.4.1",
"eslint-config-neon": "^0.1.13",
"eslint-config-neon": "^0.1.22",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^3.5.0",
"eslint-plugin-import": "^2.26.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/discord.js/package.json
Expand Up @@ -67,7 +67,7 @@
"@types/node": "^16.11.56",
"dtslint": "^4.2.1",
"eslint": "^8.23.0",
"eslint-config-neon": "latest",
"eslint-config-neon": "^0.1.22",
"jest": "^29.0.1",
"prettier": "^2.7.1",
"tsd": "^0.23.0",
Expand Down
1 change: 0 additions & 1 deletion packages/docgen/package.json
Expand Up @@ -54,7 +54,6 @@
"@typescript-eslint/eslint-plugin": "^5.36.1",
"@typescript-eslint/parser": "^5.36.1",
"eslint": "^8.23.0",
"eslint-config-marine": "^9.4.1",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^3.5.0",
"eslint-plugin-import": "^2.26.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/docgen/src/cli.ts
@@ -1,3 +1,5 @@
#!/usr/bin/env node
/* eslint-disable n/shebang */
import process from 'node:process';
import { createCommand } from 'commander';
import packageFile from '../package.json';
Expand Down
3 changes: 1 addition & 2 deletions packages/proxy-container/package.json
Expand Up @@ -53,8 +53,7 @@
"@typescript-eslint/eslint-plugin": "^5.36.1",
"@typescript-eslint/parser": "^5.36.1",
"eslint": "^8.23.0",
"eslint-config-marine": "^9.4.1",
"eslint-config-neon": "^0.1.13",
"eslint-config-neon": "^0.1.22",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^3.5.0",
"eslint-plugin-import": "^2.26.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/proxy/__tests__/proxyRequests.test.ts
@@ -1,8 +1,7 @@
import { createServer } from 'node:http';
import { REST } from '@discordjs/rest';
import supertest from 'supertest';
import type { Interceptable } from 'undici';
import { MockAgent, setGlobalDispatcher } from 'undici';
import { MockAgent, setGlobalDispatcher, type Interceptable } from 'undici';
import type { MockInterceptor } from 'undici/types/mock-interceptor';
import { beforeEach, afterAll, afterEach, test, expect } from 'vitest';
import { proxyRequests } from '../src/index.js';
Expand Down
3 changes: 1 addition & 2 deletions packages/proxy/package.json
Expand Up @@ -69,8 +69,7 @@
"@vitest/coverage-c8": "^0.22.1",
"downlevel-dts": "^0.10.1",
"eslint": "^8.23.0",
"eslint-config-marine": "^9.4.1",
"eslint-config-neon": "^0.1.13",
"eslint-config-neon": "^0.1.22",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^3.5.0",
"eslint-plugin-import": "^2.26.0",
Expand Down
10 changes: 8 additions & 2 deletions packages/proxy/src/handlers/proxyRequests.ts
@@ -1,6 +1,12 @@
import { URL } from 'node:url';
import type { RequestMethod, REST, RouteLike } from '@discordjs/rest';
import { DiscordAPIError, HTTPError, RateLimitError } from '@discordjs/rest';
import {
DiscordAPIError,
HTTPError,
RateLimitError,
type RequestMethod,
type REST,
type RouteLike,
} from '@discordjs/rest';
import {
populateAbortErrorResponse,
populateGeneralErrorResponse,
Expand Down
3 changes: 1 addition & 2 deletions packages/rest/__tests__/RequestManager.test.ts
@@ -1,5 +1,4 @@
import { MockAgent, setGlobalDispatcher } from 'undici';
import type { Interceptable } from 'undici/types/mock-interceptor';
import { MockAgent, setGlobalDispatcher, type Interceptable } from 'undici';
import { beforeEach, afterEach, test, expect } from 'vitest';
import { REST } from '../src/index.js';
import { genPath } from './util.js';
Expand Down

0 comments on commit 1023f39

Please sign in to comment.