diff --git a/.eslintrc.js b/.eslintrc.js index fc7090b..aabf974 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -31,7 +31,7 @@ module.exports = { "windows" ], "quotes": [ - "error", + "warn", "double" ], "semi": [ @@ -45,6 +45,20 @@ module.exports = { "args": "after-used", "ignoreRestSiblings": false } - ] + ], + "prefer-const": "warn", + "no-var": "error", + "no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1, "maxBOF": 0 }], + "no-lonely-if": "error", + "no-empty-function": "error", + "no-inline-comments": "error", + "no-trailing-spaces": ["error"], + "arrow-spacing": ["warn", { "before": true, "after": true }], + "space-before-function-paren": ["error", { + "anonymous": "never", + "named": "never", + "asyncArrow": "always" + }], + "comma-spacing": "error", } } diff --git a/src/commands/ban.js b/src/commands/ban.js index 7a75326..1364bb0 100644 --- a/src/commands/ban.js +++ b/src/commands/ban.js @@ -38,7 +38,7 @@ module.exports = { /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ - async execute (interaction) { + async execute(interaction) { await interaction.deferReply() diff --git a/src/commands/check.js b/src/commands/check.js index 25034b0..cdcf266 100644 --- a/src/commands/check.js +++ b/src/commands/check.js @@ -7,6 +7,7 @@ module.exports = { name: "check", description: "Check a player's stats.", type: "slash", + dev: true, data: new SlashCommandBuilder() .setName("check") diff --git a/src/commands/setnick.js b/src/commands/setnick.js index 37ce70a..a727ce9 100644 --- a/src/commands/setnick.js +++ b/src/commands/setnick.js @@ -38,4 +38,4 @@ module.exports = { await interaction.reply({ content: "Set the nickname of " + userMention(member.id) + " to " + nickname, ephemeral: true }) } -} +} diff --git a/src/events/buttons/waitingListUpdate.js b/src/events/buttons/waitingListUpdate.js index 8e12b4e..010e09d 100644 --- a/src/events/buttons/waitingListUpdate.js +++ b/src/events/buttons/waitingListUpdate.js @@ -30,7 +30,7 @@ module.exports = { } - let fields = [] + const fields = [] for (let i = 0; i < accepted.length; i++) { diff --git a/src/utils/functions/bedwars.js b/src/utils/functions/bedwars.js index 4f744cc..3b23b76 100644 --- a/src/utils/functions/bedwars.js +++ b/src/utils/functions/bedwars.js @@ -4,7 +4,7 @@ function getExpForLevel(level) { if (level == 0) return 0 - let respectedLevel = getLevelRespectingPrestige(level) + const respectedLevel = getLevelRespectingPrestige(level) if (respectedLevel > EASY_LEVELS) { return 5000 } @@ -37,12 +37,12 @@ const XP_PER_PRESTIGE = 96 * 5000 + EASY_LEVELS_XP const LEVELS_PER_PRESTIGE = 100 const HIGHEST_PRESTIGE = 50 function bedwarsLevel(exp) { - let prestiges = Math.floor(exp / XP_PER_PRESTIGE) + const prestiges = Math.floor(exp / XP_PER_PRESTIGE) let level = prestiges * LEVELS_PER_PRESTIGE let expWithoutPrestiges = exp - (prestiges * XP_PER_PRESTIGE) for (let i = 1; i <= EASY_LEVELS; ++i) { - let expForEasyLevel = getExpForLevel(i) + const expForEasyLevel = getExpForLevel(i) if (expWithoutPrestiges < expForEasyLevel) { break } diff --git a/src/utils/functions/skywars.js b/src/utils/functions/skywars.js index 3c2baf0..38e2cd0 100644 --- a/src/utils/functions/skywars.js +++ b/src/utils/functions/skywars.js @@ -2,7 +2,7 @@ Code used from the slothpixel project https://github.com/slothpixel/core */ function skywarsLevel(xp) { - let xps = [0, 20, 70, 150, 250, 500, 1000, 2000, 3500, 6000, 10000, 15000] + const xps = [0, 20, 70, 150, 250, 500, 1000, 2000, 3500, 6000, 10000, 15000] let exactLevel = 0 if (xp >= 15000) { exactLevel = (xp - 15000) / 10000 + 12