0

ESLint ERROR:'document' is not defined. [no-undef]

I have an ESLint error in my code, I have tried googling, but to little avail. The only similar issue I could find didn't have a fix. The problem is that when I put document.write("string"); into an if/else, I get an ESLint error, as you can see in the title. The same thing happens if I replace document.write("string"); with console.log("string");
Do note that the only knowledge I have for javascript is the code-academy regular JS course, and the make your own adventure text-game JS course.

//Events
Math.floor((Math.random() * 100) + 1 === this.eventChance);
if (this.eventChance <= 15) {
Math.floor((Math.random() * 100) + 1 === this.eventType);
}
if (this.eventType > 50) {
document.write("You have been raided!");
}
else
{
    document.write("You managed to secure a humanitarian aid drop!");
}
Nowondering
  • 1
  • 1
  • 5
  • See https://eslint.org/docs/user-guide/configuring#specifying-environments –  Mar 07 '18 at 21:33
  • @Amy thanks for the help, the answer in the other question worked out A-Ok, I'll mark this as duplicate so others can see that one too – Nowondering Mar 07 '18 at 22:37

0 Answers0