{"id":1034,"date":"2022-08-30T15:11:17","date_gmt":"2022-08-30T15:11:17","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/how-do-i-resolve-dependencies-when-linting-single-javascript-files-with-grunt-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:11:17","modified_gmt":"2022-08-30T15:11:17","slug":"how-do-i-resolve-dependencies-when-linting-single-javascript-files-with-grunt-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/how-do-i-resolve-dependencies-when-linting-single-javascript-files-with-grunt-collection-of-common-programming-errors\/","title":{"rendered":"How do I resolve dependencies when linting single javascript files with grunt?-Collection of common programming errors"},"content":{"rendered":"<p>The <code>jshint<\/code> options allow you to specify a list of globals that come from other libraries you are using, in your grunt.js file:<\/p>\n<pre><code>\n\n    jshint: {\n      options: {\n        curly: true,\n        eqeqeq: true,\n        immed: false,\n        latedef: true,\n        newcap: true,\n        noarg: true,\n        sub: true,\n        undef: true,\n        boss: true,\n        eqnull: true,\n        browser: true\n      },\n\n      globals: {\n        jQuery: true,\n        Backbone: true,\n        _: true\n      }\n    },\n<\/code><\/pre>\n<p>note the <code>globals<\/code> setting at the bottom. This allows JSHint to ignore these variables, but still run your <code>undef: true<\/code> setting (as shown above).<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-09 23:16:42. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>The jshint options allow you to specify a list of globals that come from other libraries you are using, in your grunt.js file: jshint: { options: { curly: true, eqeqeq: true, immed: false, latedef: true, newcap: true, noarg: true, sub: true, undef: true, boss: true, eqnull: true, browser: true }, globals: { jQuery: true, Backbone: [&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-1034","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1034","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=1034"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1034\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1034"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1034"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1034"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}