Team-Gigabyte / quotobot

Either all code paths should have explicit returns, or none of them JS-0045
Anti-pattern
Minor
5 months ago3 years old
Async arrow function expected a return value
439                        let stockData = await gotData.json();
440                        if (!gotData.ok) {
441                            message.reply(embed.error("There was an error getting stock info.", `${stockData.cod || gotData.status}: ${stockData.message || gotData.statusText}`));
442                            return;443                        }
444                        if (!stockData) {
445                            message.reply(embed.error(`${args[0]} was not found.`, "ERR_EMPTY_RESPONSE"));
Arrow function expected no return value
227    switch (command) {
228        case "amiadmin":
229            if (!message.member) return message.reply("Trick question.");
230            if (!message.member.hasPermission("ADMINISTRATOR")) return message.reply("you're not admin!");231            else return message.reply("you are admin!");
232        case "testdm":
233            message.author.send("Looks like the DM worked! You can send commands in here.")
Arrow function expected no return value
226    console.count("Command");
227    switch (command) {
228        case "amiadmin":
229            if (!message.member) return message.reply("Trick question.");230            if (!message.member.hasPermission("ADMINISTRATOR")) return message.reply("you're not admin!");
231            else return message.reply("you are admin!");
232        case "testdm":
Expected to return a value at the end of async arrow function
425            if (usedStocksRecently.has(message.author.id)) {
426                message.reply(embed.error(`You need to wait ${timeout / 1000} seconds before asking for stocks again.`, "ERR_RATE_LIMIT", "Slow down!"));
427            } else {
428                (async () => {429                    if (!stocksEnabled) {
430                        message.reply(embed.error("Stock lookup isn't currently working. Sorry about that.", "ERR_NO_STOCK_KEY"));
431                        return null;
Expected to return a value at the end of async arrow function
481                message.reply(embed.error("You didn't include any arguments. Re-run the command with the summoner name."));
482                return;
483            }
484            (async () => {485                let reg = "NA";
486
487                if (args[1]) {