Skip to content

Commit

Permalink
chore: remove @ts-expect-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite committed Jun 18, 2024
1 parent de3f24a commit bcfac40
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 4 deletions.
1 change: 0 additions & 1 deletion packages/builders/__tests__/components/button.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ describe('Button Components', () => {
}).not.toThrowError();

expect(() => {
// @ts-expect-error: discord-api-types.
const button = buttonComponent().setSKUId('123456789012345678').setStyle(ButtonStyle.Premium);
button.toJSON();
}).not.toThrowError();
Expand Down
1 change: 0 additions & 1 deletion packages/builders/src/components/Assertions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export function validateRequiredButtonParameters(
skuId?: string,
url?: string,
) {
// @ts-expect-error discord-api-types.
if (style === ButtonStyle.Premium) {
if (!skuId) {
throw new RangeError('Premium buttons must have an SKU id.');
Expand Down
2 changes: 0 additions & 2 deletions packages/builders/src/components/button/Button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ export class ButtonBuilder extends ComponentBuilder<APIButtonComponent> {
* @param skuId - The SKU id to use
*/
public setSKUId(skuId: Snowflake) {
// @ts-expect-error discord-api-types.
(this.data as APIButtonComponentWithSKUId).sku_id = skuId;
return this;
}
Expand Down Expand Up @@ -141,7 +140,6 @@ export class ButtonBuilder extends ComponentBuilder<APIButtonComponent> {
(this.data as Exclude<APIButtonComponent, APIButtonComponentWithSKUId>).label,
(this.data as Exclude<APIButtonComponent, APIButtonComponentWithSKUId>).emoji,
(this.data as APIButtonComponentWithCustomId).custom_id,
// @ts-expect-error discord-api-types.
(this.data as APIButtonComponentWithSKUId).sku_id,
(this.data as APIButtonComponentWithURL).url,
);
Expand Down

0 comments on commit bcfac40

Please sign in to comment.