{"id":697,"date":"2022-08-30T15:05:40","date_gmt":"2022-08-30T15:05:40","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/jshint-complaining-about-not-defined-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:05:40","modified_gmt":"2022-08-30T15:05:40","slug":"jshint-complaining-about-not-defined-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/jshint-complaining-about-not-defined-collection-of-common-programming-errors\/","title":{"rendered":"jshint complaining about not defined?-Collection of common programming errors"},"content":{"rendered":"<p>Why does jshint warn that gConfiguration is not defined? I have it defined before the start of the func. I also tried placing it inside. I know I can declare it as a global variable in the configuration but I don&#8217;t see what this is wrong? requirejs uses a similar pattern at the top of its declaration.<\/p>\n<pre><code>\/*jshint strict:true, undef:true *\/\n\/*global Backbone: true, $: true *\/\n\nvar gConfiguraton;\n(function (global) {\n    'use strict';\n    var MYAPP = global.MYAPP = {};\n\n    MYAPP.version = '0.0.1';\n\n    \/\/ Defaults\n    MYAPP.settings = {\n\n        \/\/ Authorization\n        authorizationKey: null,\n\n        authorizationTokenType: 'Bearer',\n\n        authorizationTimestamp: null,\n\n        \/\/ Proxy\n        proxyUrl: null\n\n    };\n\n    \/\/ Depend on jQuery and Backbone\n    if (typeof $ !== 'undefined' &amp;&amp; typeof Backbone !== 'undefined') {\n\n        \/\/ Look for global configuration provided by user and merge their settings\n        if (typeof gConfiguration !== 'undefined') {\n            $.extend(MYAPP.settings, gConfiguration);\n        }\n\n        MYAPP.Events = $.extend({}, Backbone.Events);\n    }\n\n} (this));\n<\/code><\/pre>\n<p id=\"rop\"><small>Originally posted 2013-11-09 21:40:10. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>Why does jshint warn that gConfiguration is not defined? I have it defined before the start of the func. I also tried placing it inside. I know I can declare it as a global variable in the configuration but I don&#8217;t see what this is wrong? requirejs uses a similar pattern at the top of [&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-697","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/697","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=697"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/697\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=697"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}