{"id":931,"date":"2022-08-30T15:09:34","date_gmt":"2022-08-30T15:09:34","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/how-to-tell-jshint-to-ignore-all-undefined-variables-in-one-file-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:09:34","modified_gmt":"2022-08-30T15:09:34","slug":"how-to-tell-jshint-to-ignore-all-undefined-variables-in-one-file-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/how-to-tell-jshint-to-ignore-all-undefined-variables-in-one-file-collection-of-common-programming-errors\/","title":{"rendered":"How to tell JSHint to ignore all undefined variables in one file?-Collection of common programming errors"},"content":{"rendered":"<p>The correct way to tell JSHint about globals is to use the <code>globals<\/code> directive. For example:<\/p>\n<pre><code>\/*jshint globalFunction, anotherGlobal, oneMore *\/\n<\/code><\/pre>\n<p>This will prevent &#8220;{a} is not defined&#8221; warnings when JSHint encounters any of the listed identifiers.<\/p>\n<p>Alternatively, if you really want to ignore <em>all<\/em> &#8220;not defined&#8221; warnings in that file, and you&#8217;re using JSHint 1.0.0 or above, you can simply turn off that specific warning:<\/p>\n<pre><code>\/*jshint -W117 *\/\n<\/code><\/pre>\n<p id=\"rop\"><small>Originally posted 2013-11-09 22:59:56. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>The correct way to tell JSHint about globals is to use the globals directive. For example: \/*jshint globalFunction, anotherGlobal, oneMore *\/ This will prevent &#8220;{a} is not defined&#8221; warnings when JSHint encounters any of the listed identifiers. Alternatively, if you really want to ignore all &#8220;not defined&#8221; warnings in that file, and you&#8217;re using JSHint [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-931","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/931","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=931"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/931\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}