{"action":"opened","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/10318","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/10318/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/10318/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/10318/events","html_url":"https://github.com/eslint/eslint/issues/10318","id":320505477,"number":10318,"title":"Fix should also indent comments the same as code","user":{"login":"BridgeAR","id":8822573,"avatar_url":"https://avatars2.githubusercontent.com/u/8822573?v=4","gravatar_id":"","url":"https://api.github.com/users/BridgeAR","html_url":"https://github.com/BridgeAR","followers_url":"https://api.github.com/users/BridgeAR/followers","following_url":"https://api.github.com/users/BridgeAR/following{/other_user}","gists_url":"https://api.github.com/users/BridgeAR/gists{/gist_id}","starred_url":"https://api.github.com/users/BridgeAR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BridgeAR/subscriptions","organizations_url":"https://api.github.com/users/BridgeAR/orgs","repos_url":"https://api.github.com/users/BridgeAR/repos","events_url":"https://api.github.com/users/BridgeAR/events{/privacy}","received_events_url":"https://api.github.com/users/BridgeAR/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-05T12:28:45Z","updated_at":"2018-05-05T12:28:45Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"<!--\r\n    ESLint adheres to the [JS Foundation Code of Conduct](https://js.foundation/community/code-of-conduct).\r\n\r\n    This template is for bug reports. If you are here for another reason, please see below:\r\n\r\n    1. To propose a new rule: https://eslint.org/docs/developer-guide/contributing/new-rules\r\n    2. To request a rule change: https://eslint.org/docs/developer-guide/contributing/rule-changes\r\n    3. To request a change that is not a bug fix, rule change, or new rule: https://eslint.org/docs/developer-guide/contributing/changes\r\n    4. If you have any questions, please stop by our chatroom: https://gitter.im/eslint/eslint\r\n\r\n    Note that leaving sections blank will make it difficult for us to troubleshoot and we may have to close the issue.\r\n-->\r\n\r\n**Tell us about your environment**\r\n\r\n* **ESLint Version:** 4.19.1\r\n* **Node Version:** 11-pre\r\n* **npm Version:** 5.6.0\r\n\r\n**What parser (default, Babel-ESLint, etc.) are you using?**\r\n\r\nDefault\r\n\r\n**Please show your full configuration:**\r\n\r\n<!-- Paste your configuration below: -->\r\n```js\r\nindent: error\r\n```\r\nThis is only about the fixer of indent.\r\n\r\n**What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.**\r\n\r\n<!-- Paste the source code below: -->\r\n```js\r\n'use strict';\r\n\r\nclass Foo {\r\nbar() {\r\n  if (true) {\r\n    console.log('foo');\r\n  } else if (false) {\r\n    // This is a comment starting at the line beginning.\r\n    console.log('bar');\r\n  } else {\r\n    // Do something\r\n  }\r\n  return 'hello world';\r\n}\r\n}\r\n```\r\n\r\n**What did you expect to happen?**\r\n\r\nThe expected output is:\r\n\r\n```js\r\n'use strict';\r\n\r\nclass Foo {\r\n  bar() {\r\n    if (true) {\r\n      console.log('foo');\r\n    } else if (false) {\r\n      // This is a comment starting at the line beginning.\r\n      console.log('bar');\r\n    } else {\r\n      // Do something\r\n    }\r\n    return 'hello world';\r\n  }\r\n}\r\n```\r\n\r\nBut instead it results in:\r\n\r\n```js\r\n'use strict';\r\n\r\nclass Foo {\r\n  bar() {\r\n    if (true) {\r\n      console.log('foo');\r\n    } else if (false) {\r\n    // This is a comment starting at the line beginning.\r\n      console.log('bar');\r\n    } else {\r\n    // Do something\r\n    }\r\n    return 'hello world';\r\n  }\r\n}\r\n```\r\n\r\nSo if the code lines above and below a comment get indented the same, it should also indent the comments appropriately. That they are ignored this way results in weird indentation."}}
{"actor":{"display_login":"BridgeAR"}}