{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/2965","labels_url":"https://api.github.com/repos/eslint/eslint/issues/2965/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/2965/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/2965/events","html_url":"https://github.com/eslint/eslint/issues/2965","id":94364118,"number":2965,"title":"Lines-around-comments: allowBlockStart has issue with return block","user":{"login":"gyandeeps","id":5554486,"avatar_url":"https://avatars.githubusercontent.com/u/5554486?v=3","gravatar_id":"","url":"https://api.github.com/users/gyandeeps","html_url":"https://github.com/gyandeeps","followers_url":"https://api.github.com/users/gyandeeps/followers","following_url":"https://api.github.com/users/gyandeeps/following{/other_user}","gists_url":"https://api.github.com/users/gyandeeps/gists{/gist_id}","starred_url":"https://api.github.com/users/gyandeeps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gyandeeps/subscriptions","organizations_url":"https://api.github.com/users/gyandeeps/orgs","repos_url":"https://api.github.com/users/gyandeeps/repos","events_url":"https://api.github.com/users/gyandeeps/events{/privacy}","received_events_url":"https://api.github.com/users/gyandeeps/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eslint/eslint/labels/triage","name":"triage","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2015-07-10T18:25:23Z","updated_at":"2015-08-20T12:24:25Z","closed_at":null,"body":"Eslint: v0.24.1\r\nPraser: default\r\n\r\nRule config:\r\n```json\r\n{\r\n    \"lines-around-comment\": [2, { \r\n        \"beforeLineComment\": true, \r\n        \"beforeBlockComment\": true, \r\n        \"allowBlockStart\": true \r\n    }]\r\n}\r\n```\r\n\r\n**Code:**\r\n\r\n```js\r\n/* eslint lines-around-comment:[2, { beforeLineComment: true, beforeBlockComment: true, allowBlockStart: true }]  */\r\nfunction hi(){\r\n\treturn{\r\n\t\t/**\r\n\t\t* hi\r\n\t\t*/\r\n\t\ttest: function() {\r\n\t\t}\r\n\t}\r\n}\r\n```\r\n\r\n**Actual:**\r\n```sh\r\n$ eslint --reset index.js\r\n\r\nindex.js\r\n  4:2  error  Expected line before comment  lines-around-comment\r\n\r\n? 1 problem (1 error, 0 warnings)\r\n```\r\n\r\n**Expected:**\r\n No errors."},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/132990948","html_url":"https://github.com/eslint/eslint/issues/2965#issuecomment-132990948","issue_url":"https://api.github.com/repos/eslint/eslint/issues/2965","id":132990948,"user":{"login":"mathieumg","id":1624812,"avatar_url":"https://avatars.githubusercontent.com/u/1624812?v=3","gravatar_id":"","url":"https://api.github.com/users/mathieumg","html_url":"https://github.com/mathieumg","followers_url":"https://api.github.com/users/mathieumg/followers","following_url":"https://api.github.com/users/mathieumg/following{/other_user}","gists_url":"https://api.github.com/users/mathieumg/gists{/gist_id}","starred_url":"https://api.github.com/users/mathieumg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathieumg/subscriptions","organizations_url":"https://api.github.com/users/mathieumg/orgs","repos_url":"https://api.github.com/users/mathieumg/repos","events_url":"https://api.github.com/users/mathieumg/events{/privacy}","received_events_url":"https://api.github.com/users/mathieumg/received_events","type":"User","site_admin":false},"created_at":"2015-08-20T12:24:25Z","updated_at":"2015-08-20T12:24:25Z","body":"My stab at this: https://github.com/mathieumg/eslint/commit/3c4df6179b924dd27de08ce46cef0513d2936093\r\n\r\nI didn't update the documentation or provide many tests, *yet*, because of some hurdles related to the discussion above. Should `allowObject__` and `allowArray__` options only consider proper objects/arrays or also consider destructuring using braces/brackets? If no, does it mean we need to add `allowArrayPattern__` and `allowObjectPattern__` as well? I feel we're in for quite a ride, if so.\r\n\r\nThe commit I linked to implements the first approach to simplify things. However, let me bring something new to the discussion: I realized that the exception case is always when the line above is less indented (with `allow__Start`) or the line below is less indented (with `allow__End`), would an option that leverages that fact be better than starting to consider all possible individual cases?\r\n\r\nThanks."}}