Why does it tell me that everything is incorrect (when it worked fine in VS Code when I used it)?

Hello

I have just got this IDE and it's playing up. Lots of stuff, including the requires, is showing up as incorrect. I've tried to change the language to ECMAScript6 and that has cleared up some stuff but not all.

I'm working on a Discord bot in the library of discord.js.

6 comments

Please provide code sample (files/code snippets) that shows up the issue

0

const package = require("../package.json");
const Discord = require("discord.js");

module.exports = async(client, message, args) => {
    const embed = new Discord.RichEmbed()
    .setAuthor(client.user.username, client.user.avatarURL)
    .setTitle("Pong! 🏓")
    .setColor(0x3c00ff)
    .setFooter("This message took me " + Math.floor(client.ping) + "ms! | v" + package.version)
    message.channel.send({embed});

    console.log(`[info] Treating ${message.content} by ${message.author.tag} from ${message.guild} as a command.`);
}

 

So it says both the requires are wrong, that it needs a semi-colon at the end of the embed and at the end of this code snippet. This all works perfectly when I open the bot.

0

works fine for me... Webstorm shows a pair of warnings for this code (`reserved word used as name` for `const package` and `unterminated statement` for missing semicolons).

 

You can ignore/disable these warnings if your code style doesn't require using semicolons, etc.

0

How would I disable them? Sorry I'm a new user with this.

0

Please sign in to leave a comment.