{"action":"reopened","issue":{"url":"https://api.github.com/repos/jscs-dev/jscs-jsdoc/issues/176","labels_url":"https://api.github.com/repos/jscs-dev/jscs-jsdoc/issues/176/labels{/name}","comments_url":"https://api.github.com/repos/jscs-dev/jscs-jsdoc/issues/176/comments","events_url":"https://api.github.com/repos/jscs-dev/jscs-jsdoc/issues/176/events","html_url":"https://github.com/jscs-dev/jscs-jsdoc/issues/176","id":117954441,"number":176,"title":"Parameter validation wrongly associates closure and doc block","user":{"login":"Krinkle","id":156867,"avatar_url":"https://avatars.githubusercontent.com/u/156867?v=3","gravatar_id":"","url":"https://api.github.com/users/Krinkle","html_url":"https://github.com/Krinkle","followers_url":"https://api.github.com/users/Krinkle/followers","following_url":"https://api.github.com/users/Krinkle/following{/other_user}","gists_url":"https://api.github.com/users/Krinkle/gists{/gist_id}","starred_url":"https://api.github.com/users/Krinkle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Krinkle/subscriptions","organizations_url":"https://api.github.com/users/Krinkle/orgs","repos_url":"https://api.github.com/users/Krinkle/repos","events_url":"https://api.github.com/users/Krinkle/events{/privacy}","received_events_url":"https://api.github.com/users/Krinkle/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jscs-dev/jscs-jsdoc/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/jscs-dev/jscs-jsdoc/milestones/2","html_url":"https://github.com/jscs-dev/jscs-jsdoc/milestones/v1.3.0","labels_url":"https://api.github.com/repos/jscs-dev/jscs-jsdoc/milestones/2/labels","id":860972,"number":2,"title":"v1.3.0","description":"Improvements","creator":{"login":"zxqfox","id":677518,"avatar_url":"https://avatars.githubusercontent.com/u/677518?v=3","gravatar_id":"","url":"https://api.github.com/users/zxqfox","html_url":"https://github.com/zxqfox","followers_url":"https://api.github.com/users/zxqfox/followers","following_url":"https://api.github.com/users/zxqfox/following{/other_user}","gists_url":"https://api.github.com/users/zxqfox/gists{/gist_id}","starred_url":"https://api.github.com/users/zxqfox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zxqfox/subscriptions","organizations_url":"https://api.github.com/users/zxqfox/orgs","repos_url":"https://api.github.com/users/zxqfox/repos","events_url":"https://api.github.com/users/zxqfox/events{/privacy}","received_events_url":"https://api.github.com/users/zxqfox/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"closed","created_at":"2014-11-11T01:01:06Z","updated_at":"2015-12-09T22:28:22Z","due_on":null,"closed_at":"2015-12-07T02:39:48Z"},"comments":4,"created_at":"2015-11-20T02:47:31Z","updated_at":"2015-12-09T22:28:22Z","closed_at":null,"body":"JSDuck supports the concept of documenting class members not explicitly declared in code. Typically this is used for creating basic entities for upstream libraries.\r\n\r\nExamples:\r\n* https://github.com/senchalabs/jsduck/blob/v5.3.4/js-classes/Array.js\r\n* https://github.com/wikimedia/VisualEditor/blob/REL1_25/.jsduck/external.js\r\n\r\nIn general however it uses the rule that a documentation block and code are only associated when directly connected. If there is an empty line between, then it is no longer associated.\r\n\r\nSo e.g.\r\n\r\n```js\r\n/**\r\n * Descriptive description of Foo.\r\n *\r\n * @class Foo\r\n */\r\n\r\n/**\r\n * Descriptive description of bar.\r\n *\r\n * @method bar\r\n * @param x\r\n */\r\n\r\n( function ( $ ) {\r\n  ..\r\n}( jQuery ) );\r\n```\r\n\r\nWould not associate method bar with the closure. And it would not throw a warning about parameter `x` not matching `$`, for two reasons:\r\n\r\n* There is a new line in between.\r\n* It is not a plain function declaration or expression assigned to a property in an object literal, or variable assignment. As such, the function seen there is irrelevant.\r\n\r\nThe same is like this:\r\n\r\n```js\r\n/**\r\n * @param x\r\n */\r\nvar foo = ( function ( y, z ) {\r\n  ..\r\n  return function ( x ) { .. };\r\n}( 1, 2 ) );\r\n```\r\n\r\n\r\nI'm not sure whether this error is a regression, or that it is part of a new rule. But for Wikimedia, [jquery.suggestions.js (source code)](https://github.com/wikimedia/mediawiki/blob/2e4bc3f9da14c308a12e1f099ecf43d62a89a176/resources/src/jquery/jquery.suggestions.js#L22-L31) is causing the following warning:\r\n```\r\n   27 | * @param {Object} options\r\n13:54:14 Expected $ but got options at ./resources/src/jquery/jquery.suggestions.js :\r\n```\r\n\r\nBecause it is wrongly associating the block with the closure."}}