Skip to content

Commit

Permalink
Fix lint problems after #276
Browse files Browse the repository at this point in the history
  • Loading branch information
utarwyn committed Jul 27, 2022
1 parent 285f78b commit d9aa97b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
10 changes: 6 additions & 4 deletions src/__tests__/GameStateValidator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import {
GuildMember,
GuildMemberManager,
GuildMemberRoleManager,
PermissionsBitField, PermissionsString, Role,
PermissionsBitField,
PermissionsString,
Role,
TextChannel
} from 'discord.js';

Expand Down Expand Up @@ -62,9 +64,9 @@ describe('GameStateValidator', () => {
const spyError = jest.spyOn(global.console, 'error').mockImplementation();
jest.spyOn(tunnel.channel.guild.members.me!, 'permissionsIn').mockReturnValue(<
Readonly<PermissionsBitField>
>{
has: list => (list as Array<PermissionsString>).every(k => permissions.includes(k))
});
>{
has: list => (list as Array<PermissionsString>).every(k => permissions.includes(k))
});

expect(validator.isInteractionValid(tunnel)).toBe(expected);
expect(spyError).toHaveBeenCalledTimes(expected ? 0 : 1);
Expand Down
13 changes: 6 additions & 7 deletions src/bot/builder/GameBoardButtonBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import GameBoardBuilder from '@bot/builder/GameBoardBuilder';
import Entity from '@tictactoe/Entity';
import { Player } from '@tictactoe/Player';
import {
ActionRowBuilder,
ButtonBuilder,
ButtonStyle,
MessageOptions
} from 'discord.js';
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, MessageOptions } from 'discord.js';

/**
* Builds representation of a game board using buttons
Expand All @@ -25,7 +20,11 @@ export default class GameBoardButtonBuilder extends GameBoardBuilder {
* Button styles used for representing the two players.
* @private
*/
private buttonStyles: ButtonStyle[] = [ButtonStyle.Secondary, ButtonStyle.Primary, ButtonStyle.Danger];
private buttonStyles: ButtonStyle[] = [
ButtonStyle.Secondary,
ButtonStyle.Primary,
ButtonStyle.Danger
];
/**
* Stores if emojies have been customized.
* @private
Expand Down
4 changes: 2 additions & 2 deletions src/bot/entity/DuelRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ export default class DuelRequest {
allowedMentions: { parse: ['users'] },
components: !this.useReactions
? [
new ActionRowBuilder<ButtonBuilder>().addComponents(
new ButtonBuilder({
new ActionRowBuilder<ButtonBuilder>().addComponents(
new ButtonBuilder({
style: ButtonStyle.Success,
customId: 'yes',
label: localize.__('duel.button.accept')
Expand Down
4 changes: 3 additions & 1 deletion src/bot/entity/GameBoard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ export default class GameBoard {
*
* @param interaction interaction to update if action was triggered by it
*/
public async update(interaction?: ButtonInteraction): Promise<InteractionResponse<boolean> | void> {
public async update(
interaction?: ButtonInteraction
): Promise<InteractionResponse<boolean> | void> {
if (interaction) {
return interaction.update(this.content);
} else {
Expand Down

0 comments on commit d9aa97b

Please sign in to comment.