javascript-basics icon indicating copy to clipboard operation
javascript-basics copied to clipboard

ESlint breaks build when using console.log

Open cinthialandia opened this issue 6 years ago • 2 comments

Hello, thanks for this course!!

Doing the course I found a problem when I tried to used console.log:

11:5 error Unexpected console statement no-console 13:5 error Unexpected console statement no-console

Someone help me out with this problem and explained to me that the issue was caused by the library ESlint, specifically, the rule no-console that comes with "eslint:recommended" rules.

I don't know if this is intended, but it prevents working with the examples and see the results in the console.

thanks :)

cinthialandia avatar Jul 01 '19 09:07 cinthialandia

Hey Cinthia! You're welcome, could you share your .eslintrc.json file? :D

toddmotto avatar Jul 01 '19 10:07 toddmotto

Hello! This is the .eslintrc.json file:

{
  "env": {
    "browser": true,
    "es6": true
  },
  "extends": "eslint:recommended",
  "globals": {
    "Atomics": "readonly",
    "SharedArrayBuffer": "readonly"
  },
  "parserOptions": {
    "ecmaVersion": 2018,
    "sourceType": "module"
  },
  "rules": { }
}

Note: I downloaded the zip file from the Project Setup module instead of cloning this repo.

The way I solved it was adding "no-console": 0 to the set of rules.

cinthialandia avatar Jul 02 '19 09:07 cinthialandia