<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic JSHint can be pickier than in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Error-warning-in-JS-Hint-problems/m-p/1122023#M76453</link>
    <description>&lt;P&gt;JSHint can be pickier than the browser, which is by design.&amp;nbsp; Fortunately there are a number of options to control it's behavior and solve problems like yours.&lt;/P&gt;

&lt;P&gt;One would be to declare your globals in a comment like this:&lt;/P&gt;

&lt;PRE style="box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; display: block; padding: 9.5px; margin: 0px 0px 10px; line-height: 1.42857; color: rgb(51, 51, 51); word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(245, 245, 245);"&gt;&lt;CODE style="box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; padding: 0px; color: inherit; white-space: pre-wrap; border-radius: 4px; border: 0px; background-color: transparent;"&gt;/*jshint undef: true, unused: true */
/*global MY_GLOBAL */&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;CODE style="box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; padding: 0px; color: inherit; white-space: pre-wrap; border-radius: 4px; border: 0px; background-color: transparent;"&gt;You could also turn it off with:&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE style="box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; display: block; padding: 9.5px; margin: 0px 0px 10px; line-height: 1.42857; color: rgb(51, 51, 51); word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(245, 245, 245);"&gt;&lt;CODE style="box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; padding: 0px; color: inherit; white-space: pre-wrap; border-radius: 4px; border: 0px; background-color: transparent;"&gt;//jshint undef:true&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;At least that's the what &lt;A href="http://jshint.com/docs/"&gt;this site&lt;/A&gt; tells me.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;EDIT:&lt;/STRONG&gt; it is very important that there be no space between the opening comment marker and the jshint directives. Your jshint directives will be ignored if you do not follow this policy. Also, to make the /*global ... */ option easier to manage, put your globals inside a few objects, for example, rather than defining globals as:&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;var global1 = 0 ;
var global2 = 0 ;
var global3 = 0 ;&lt;/PRE&gt;

&lt;P&gt;Use something like:&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;window.myGlobals = window.myGlobals || {} ;
myGlobals.global1 = 0 ;
myGlobals.global2 = 0 ;
myGlobals.global3 = 0 ;&lt;/PRE&gt;

&lt;P&gt;That way you can do this:&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;/*global myGlobals:false */&lt;/PRE&gt;

&lt;P&gt;Rather than having to do this:&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;/*global global1:false, global2:false, global3:false */&lt;/PRE&gt;

&lt;P&gt;Which helps if you have a lot of globals...&lt;/P&gt;</description>
    <pubDate>Wed, 23 Mar 2016 23:09:00 GMT</pubDate>
    <dc:creator>Dale_S_Intel</dc:creator>
    <dc:date>2016-03-23T23:09:00Z</dc:date>
    <item>
      <title>Error warning in JS Hint problems</title>
      <link>https://community.intel.com/t5/Software-Archive/Error-warning-in-JS-Hint-problems/m-p/1122022#M76452</link>
      <description>&lt;P&gt;I´m using several .js files in my app with many global variables and constants declared in my first .js file and all js files declared in my html file. All run perfectelly in browser, emulate and in app Preview in my mobiles but when de variable is not in the same file the JS Hint inform that is not defined, the same problem with functions used in diferent files that is not the same that is called. The list is so huge that I can´t locate real erros in my JS Hint. I did something wrong? I was a AS3 programmer and there we use import declaration at the beginning of file. I search for the same resource for JS but I can find. Please help.&lt;/P&gt;

&lt;P&gt;P.S.: I´m using a 3088 version of intel XDK&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2016 22:57:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Error-warning-in-JS-Hint-problems/m-p/1122022#M76452</guid>
      <dc:creator>Adolfo_C_1</dc:creator>
      <dc:date>2016-03-23T22:57:01Z</dc:date>
    </item>
    <item>
      <title>JSHint can be pickier than</title>
      <link>https://community.intel.com/t5/Software-Archive/Error-warning-in-JS-Hint-problems/m-p/1122023#M76453</link>
      <description>&lt;P&gt;JSHint can be pickier than the browser, which is by design.&amp;nbsp; Fortunately there are a number of options to control it's behavior and solve problems like yours.&lt;/P&gt;

&lt;P&gt;One would be to declare your globals in a comment like this:&lt;/P&gt;

&lt;PRE style="box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; display: block; padding: 9.5px; margin: 0px 0px 10px; line-height: 1.42857; color: rgb(51, 51, 51); word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(245, 245, 245);"&gt;&lt;CODE style="box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; padding: 0px; color: inherit; white-space: pre-wrap; border-radius: 4px; border: 0px; background-color: transparent;"&gt;/*jshint undef: true, unused: true */
/*global MY_GLOBAL */&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;CODE style="box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; padding: 0px; color: inherit; white-space: pre-wrap; border-radius: 4px; border: 0px; background-color: transparent;"&gt;You could also turn it off with:&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE style="box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; display: block; padding: 9.5px; margin: 0px 0px 10px; line-height: 1.42857; color: rgb(51, 51, 51); word-break: break-all; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); border-radius: 4px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(245, 245, 245);"&gt;&lt;CODE style="box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: inherit; padding: 0px; color: inherit; white-space: pre-wrap; border-radius: 4px; border: 0px; background-color: transparent;"&gt;//jshint undef:true&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;At least that's the what &lt;A href="http://jshint.com/docs/"&gt;this site&lt;/A&gt; tells me.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;EDIT:&lt;/STRONG&gt; it is very important that there be no space between the opening comment marker and the jshint directives. Your jshint directives will be ignored if you do not follow this policy. Also, to make the /*global ... */ option easier to manage, put your globals inside a few objects, for example, rather than defining globals as:&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;var global1 = 0 ;
var global2 = 0 ;
var global3 = 0 ;&lt;/PRE&gt;

&lt;P&gt;Use something like:&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;window.myGlobals = window.myGlobals || {} ;
myGlobals.global1 = 0 ;
myGlobals.global2 = 0 ;
myGlobals.global3 = 0 ;&lt;/PRE&gt;

&lt;P&gt;That way you can do this:&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;/*global myGlobals:false */&lt;/PRE&gt;

&lt;P&gt;Rather than having to do this:&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;/*global global1:false, global2:false, global3:false */&lt;/PRE&gt;

&lt;P&gt;Which helps if you have a lot of globals...&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2016 23:09:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Error-warning-in-JS-Hint-problems/m-p/1122023#M76453</guid>
      <dc:creator>Dale_S_Intel</dc:creator>
      <dc:date>2016-03-23T23:09:00Z</dc:date>
    </item>
    <item>
      <title>I didn´t understand at the</title>
      <link>https://community.intel.com/t5/Software-Archive/Error-warning-in-JS-Hint-problems/m-p/1122024#M76454</link>
      <description>&lt;P&gt;I didn´t understand at the first time but readding the JSHint documentation all be cleared.&amp;nbsp;&lt;SPAN style="font-size: 13.008px; line-height: 19.512px;"&gt;It´s really help. Thank you!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2016 02:20:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Error-warning-in-JS-Hint-problems/m-p/1122024#M76454</guid>
      <dc:creator>Adolfo_C_1</dc:creator>
      <dc:date>2016-03-25T02:20:18Z</dc:date>
    </item>
  </channel>
</rss>

