error handling - disable JsHint warnings in Intel XDK -


the brackets editor in intel xdk requiring me strange things in js file. if try make ajax call, jshint give me error:

`$ not defined (w117).`  

the way i've been able figure out how rid of warning seems wrong me. have declare

`var $;`.   

it's same thing when use 'document' manipulate dom. if don't do

`var document;`  

first not defined warning. issue?

if go jshint documentation (found here: http://jshint.com/docs/) it'll tell

configuration jshint comes default set of warnings designed configurable. there 3 main ways configure copy of jshint: can either specify configuration file manually via --config flag, use special file .jshintrc or put config projects package.json file under jshintconfig property. in case of .jshintrc, jshint start looking file in same directory file that's being linted. if not found, move 1 level directory tree way filesystem root. (note if input comes stdin, jshint doesn't attempt find configuration file)

this setup allows have different configuration files per project. place file project root directory and, long run jshint anywhere within project directory tree, same configuration file used.

configuration file simple json file specifies jshint options turn on or off. example, following file enable warnings undefined , unused variables , tell jshint global variable named my_global.

{   "undef": true,   "unused": true,   "predef": [ "my_global" ] } 

inline configuration in addition using configuration files can configure jshint within files using special comments. these comments start label such jshint or globals (complete list below) , followed comma-separated list of values. example, following snippet enable warnings undefined , unused variables , tell jshint global variable named my_global.

/* jshint undef: true, unused: true */ /* globals my_global */ 

you can use both multi- , single-line comments configure jshint. these comments function scoped meaning if put them inside function affect function's code.

here's more inline disabling from https://man42.net/blog/2013/04/jshint-disable-warning-globally/

there 2 ways disable specific warning in jshint:  locally, inserting comment in javascript file: /*jshint -w099 */  globally, editing .jshintrc file:  {   /* ... */    "-w099": false, // disable: mixed spaces , tabs.   "-w065": false, // disable: missing radix parameter.   "-w015": false, // disable: expected 'x' have indentation @ y instead @ z.   "-w116": false, // disable: expected '===' , instead saw '=='. } 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -