javascript - A couple of issues with JSHint: 'is defined but never used' and 'is not defined' -


i have application pretty modular , such, jshint giving me 'x' defined never used error.

my setup goes this:

app/assets/scripts/bootstrap.js: var x = 5;

app/assets/scripts/kickstart.js: console.log(x);

and here's output jshint:

app/assets/scripts/bootstrap.js   line 1  col 6   'x' defined never used.  app/assets/scripts/kickstart.js   line 1  col 13  'x' not defined.  2 problems 

i know /* exported x */ cumbersome if have lots of variables this.

is there anyway solve these 2 issues without disabling specific options? because come in handy in other, more important, situations.

you can add @ top of file.

/*jshint unused: false, undef:false */ 

notice options can applied specific scopes. works unused, apparently not undef.

(function () {   /*jshint unused: false */    // stuff }()); 

Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -