{"id":691,"date":"2022-08-30T15:05:34","date_gmt":"2022-08-30T15:05:34","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/jshint-allow-empty-return-statements-with-asi-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:05:34","modified_gmt":"2022-08-30T15:05:34","slug":"jshint-allow-empty-return-statements-with-asi-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/jshint-allow-empty-return-statements-with-asi-collection-of-common-programming-errors\/","title":{"rendered":"JSHint: Allow empty return statements with ASI-Collection of common programming errors"},"content":{"rendered":"<p>In my JavaScript I want to have a function exit early if certain conditions are not met, like in the following example.<\/p>\n<pre><code>(function () {\n  var something = false\n\n  if (!something) return\n\n  doMoreStuff()\n}())\n<\/code><\/pre>\n<p>I&#8217;m ommitting semicolons out of preference and it works just fine (the above snippet works as expected).<\/p>\n<p>JSHint keeps giving me the error <code>Line breaking error 'return'<\/code>. While this can be fixed by including a semicolon after the return statement, I&#8217;d rather keep semicolons out of my script.<\/p>\n<p>Is there any option I can set to allow for an empty return at the end of a line without a semicolon?<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-09 21:39:45. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>In my JavaScript I want to have a function exit early if certain conditions are not met, like in the following example. (function () { var something = false if (!something) return doMoreStuff() }()) I&#8217;m ommitting semicolons out of preference and it works just fine (the above snippet works as expected). JSHint keeps giving me [&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-691","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/691","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=691"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/691\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}