Skip to content

Commit 98db1b5

Browse files
committed
chore: fix biome complaints
1 parent d5d7235 commit 98db1b5

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

src/commands/util/close.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,16 @@ export async function handleIssueState(interaction: ChatInputCommandInteraction,
5656
}
5757
}
5858

59-
export async function handleIssueStateCommand(interaction: ChatInputCommandInteraction, close: boolean, lock: boolean = false) {
59+
export async function handleIssueStateCommand(interaction: ChatInputCommandInteraction, close: boolean, lock = false) {
6060
const interactionChannel = await getChannelFromInteraction(interaction);
6161
const stateVerb = getStateVerb(close);
6262

6363
// Check if thread is a help post and if user can interact
6464
if (await isHelpPost(interactionChannel)) {
6565
if (canUserInteractWithThread(interaction.channel as ThreadChannel, interaction.user)) {
6666
return handleIssueState(interaction, close, lock);
67+
68+
// biome-ignore lint/style/noUselessElse: the else is not useless
6769
} else {
6870
await interaction.reply({
6971
content: `You cannot ${stateVerb} this thread since you are not the OP.`,

src/commands/util/walkthrough.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import issueCategorySelector from "@components/issueCategorySelector.js";
55

66
import {
77
type ChatInputCommandInteraction, SlashCommandBuilder,
8-
ActionRowBuilder, StringSelectMenuBuilder, EmbedBuilder, type Embed, Colors,
9-
PublicThreadChannel,
10-
GuildTextBasedChannel
8+
ActionRowBuilder, type StringSelectMenuBuilder, EmbedBuilder, type Embed, Colors,
9+
type PublicThreadChannel,
10+
type GuildTextBasedChannel
1111
} from "discord.js";
1212

1313
export function generateMessage(question: string, component: StringSelectMenuBuilder, embeds: (EmbedBuilder | Embed)[] = []) {
@@ -39,6 +39,8 @@ export async function doWalkthrough(channel: GuildTextBasedChannel, interaction?
3939
if(interaction) {
4040
// TODO: check if walkthrough has already been sent
4141
return interaction.reply(message);
42+
43+
// biome-ignore lint/style/noUselessElse: the else is not useless
4244
} else {
4345
return channel.send(message);
4446
}

src/deploy-commands.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const commandData = Object.values(commands).map(command => command.data);
1111
console.log(`Started refreshing ${commandData.length} application (/) commands.`);
1212

1313
// The put method is used to fully refresh all commands in the guild with the current set
14+
// biome-ignore lint/suspicious/noExplicitAny: TODO: need to figure out the proper type
1415
const data: any = await rest.put(
1516
Routes.applicationGuildCommands("1063886601165471814", config.serverId), // TODO: guess client ID from token
1617
{ body: commandData },

src/events/walkthrough.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import issueCategorySelector from "@components/issueCategorySelector.js";
44
import productSelector from "@components/productSelector.js";
55
import operatingSystemFamilySelector from "@components/operatingSystemFamilySelector.js";
66

7-
import { type Client, EmbedBuilder, Events } from "discord.js";
7+
import { type Client, EmbedBuilder, Events, type InteractionUpdateOptions } from "discord.js";
88

99
export default function registerEvents(client: Client) {
1010
// Do walkthrough whenever a thread is opened
@@ -13,7 +13,7 @@ export default function registerEvents(client: Client) {
1313
// Register events for the actual walkthrough steps
1414
client.on(Events.InteractionCreate, async (interaction) => {
1515
if(interaction.isStringSelectMenu()) {
16-
let message;
16+
let message: InteractionUpdateOptions;
1717

1818
// TODO : make this code more generic
1919
if(interaction.customId === issueCategorySelector.data.custom_id) {

src/lib/channels.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { config } from "@lib/config.js";
22

3-
import { type ChatInputCommandInteraction, ChannelType, type ThreadChannel, type User, Channel, GuildChannel, Guild, GuildTextBasedChannel } from "discord.js";
3+
import { type ChatInputCommandInteraction, ChannelType, type ThreadChannel, type User, type GuildTextBasedChannel } from "discord.js";
44

55
export async function getChannelFromInteraction(interaction: ChatInputCommandInteraction): Promise<GuildTextBasedChannel> {
66
return interaction.channel ?? (interaction.client.channels.fetch(interaction.channelId) as Promise<GuildTextBasedChannel>);
@@ -18,7 +18,7 @@ async function isForumPost(channel: GuildTextBasedChannel) {
1818
}
1919

2020
export async function isHelpPost(channel: GuildTextBasedChannel) {
21-
return (await isForumPost(channel)) && channel.parent.id == config.helpChannel.id;
21+
return (await isForumPost(channel)) && channel.parent.id === config.helpChannel.id;
2222
}
2323

2424
export async function canUserInteractWithThread(channel: ThreadChannel, user: User) {

0 commit comments

Comments
 (0)