Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR: 'console is not defined. [no-undef] - Brackets

I've installed brackets and currently playing around with variables and functions. All the outputs work fine in the console, however I keep getting this error in the editor.

ERROR: 'Console' is not defined (no-undef)

How do I go about fixing this?

like image 631
Riddick Avatar asked Mar 28 '18 02:03

Riddick


1 Answers

The no-undef rule looks out for undefined variable, without any initial assumption on the environment and the global variables (console for instance).

You can specify that you are in an environment where console indeed exists, by adding browser and/or node envs in your .eslintrc:

  env: {     browser: true,     node: true,   }, 

More info in the rule doc

like image 194
Amaury Liet Avatar answered Sep 20 '22 15:09

Amaury Liet