{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/6571","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/6571/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/6571/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/6571/events","html_url":"https://github.com/eslint/eslint/issues/6571","id":163260952,"number":6571,"title":"Indentation fix is misbehaving and ignoring comments","user":{"login":"adambuczynski","id":490562,"avatar_url":"https://avatars.githubusercontent.com/u/490562?v=3","gravatar_id":"","url":"https://api.github.com/users/adambuczynski","html_url":"https://github.com/adambuczynski","followers_url":"https://api.github.com/users/adambuczynski/followers","following_url":"https://api.github.com/users/adambuczynski/following{/other_user}","gists_url":"https://api.github.com/users/adambuczynski/gists{/gist_id}","starred_url":"https://api.github.com/users/adambuczynski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adambuczynski/subscriptions","organizations_url":"https://api.github.com/users/adambuczynski/orgs","repos_url":"https://api.github.com/users/adambuczynski/repos","events_url":"https://api.github.com/users/adambuczynski/events{/privacy}","received_events_url":"https://api.github.com/users/adambuczynski/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eslint/eslint/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/eslint/eslint/labels/evaluating","name":"evaluating","color":"fef2c0"},{"url":"https://api.github.com/repos/eslint/eslint/labels/rule","name":"rule","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-06-30T20:34:38Z","updated_at":"2016-10-16T20:27:25Z","closed_at":null,"body":"**What version of ESLint are you using?**\r\nI am using [Atom Linter's ESLint package](https://github.com/AtomLinter/linter-eslint), which specified ESLint `^2.11.1` in it's package.json. \r\n\r\n**What parser (default, Babel-ESLint, etc.) are you using?**\r\nAtom Linter ESLint\r\n\r\n**Please show your full configuration:**\r\n```yaml\r\nroot: true\r\nextends: eslint:recommended\r\nparserOptions:\r\n  ecmaVersion: 6\r\n  ecmaFeatures:\r\n    impliedStrict: true\r\n  sourceType: module\r\nenv:\r\n  es6: true\r\n  browser: true\r\n  node: true\r\n  mocha: true\r\n  jasmine: true\r\nrules:\r\n  linebreak-style:\r\n    - error\r\n    - unix\r\n  max-len:\r\n    - error\r\n    - code: 100\r\n      tabWidth: 2\r\n      ignoreComments: true\r\n      ignoreUrls: true\r\n  indent:\r\n    - error\r\n    - 2\r\n    - SwitchCase: 1\r\n      VariableDeclarator:\r\n        let: 2\r\n        const: 3\r\n  semi:\r\n    - error\r\n    - always\r\n  consistent-this:\r\n    - error\r\n    - self\r\n    - $ctrl\r\n  quotes:\r\n    - error\r\n    - single\r\n    - allowTemplateLiterals: true\r\n  curly:\r\n    - error\r\n    - all\r\n  comma-dangle:\r\n    - error\r\n    - only-multiline\r\n  new-cap:\r\n    - error\r\n    - newIsCap: true\r\n      capIsNew: true\r\n      properties: true\r\n  camelcase:\r\n    - error\r\n    - properties: never\r\n  array-bracket-spacing:\r\n    - error\r\n    - never\r\n  arrow-spacing:\r\n    - error\r\n    - before: true\r\n      after: true\r\n  block-spacing:\r\n    - error\r\n    - always\r\n  comma-spacing:\r\n    - error\r\n    - before: false\r\n      after: true\r\n  computed-property-spacing:\r\n    - error\r\n    - never\r\n  generator-star-spacing:\r\n    - error\r\n    - before: true\r\n      after: false\r\n  key-spacing:\r\n    - error\r\n    - beforeColon: false\r\n      afterColon: true\r\n      mode: minimum\r\n  keyword-spacing:\r\n    - error\r\n    - before: true\r\n  semi-spacing:\r\n    - error\r\n    - before: false\r\n      after: true\r\n  space-in-parens:\r\n    - error\r\n    - never\r\n  space-unary-ops:\r\n    - error\r\n    - words: true\r\n      nonwords: false\r\n  space-before-function-paren:\r\n    - error\r\n    - never\r\n  space-before-blocks:\r\n    - error\r\n    - always\r\n  yoda:\r\n    - error\r\n    - never\r\n  wrap-iife:\r\n    - error\r\n    - outside\r\n  eqeqeq:\r\n    - error\r\n    - always\r\n  newline-per-chained-call:\r\n    - error\r\n    - ignoreChainWithDepth: 2\r\n  one-var-declaration-per-line:\r\n    - error\r\n    - initializations\r\n  brace-style:\r\n    - error\r\n    - stroustrup\r\n  eol-last: error\r\n  dot-notation: error\r\n  space-infix-ops: error\r\n  no-with: error\r\n  no-unreachable: error\r\n  no-redeclare: error\r\n  no-unexpected-multiline: error\r\n  no-multi-spaces: error\r\n  no-multi-str: error\r\n  no-trailing-spaces: error\r\n  no-mixed-spaces-and-tabs: error\r\n  no-spaced-func: error\r\n  no-whitespace-before-property: error\r\n  no-lonely-if: error\r\n  no-var: error\r\n  no-implicit-coercion: error\r\n```\r\n\r\n**What did you do? Please include the actual source code causing the issue.**\r\nThis is a portion of the source code that is affected. Note that to prevent errors about max line length, I have moved the mixins onto a separate line, but afterwards I open the curly bracket on the first indentation level to prevent the whole file from being indented too much:\r\n\r\n```js\r\nexport default FlowController.extend(\r\n  BookAppointment, ProcessOutcome, PreventNavigation,\r\n{\r\n\r\n  //Nav model\r\n  navModel: Nav.create({\r\n    pageTitle: '...'\r\n  }),\r\n\r\n  //Model aliases\r\n  client: Ember.computed.reads('model.client'),\r\n  cards: Ember.computed.reads('model.cards'),\r\n\r\n  /**\r\n   * Ok to navigate away check\r\n   */\r\n  isOkToNavigateAway(targetRoute) {\r\n\r\n    //Still in first screen\r\n    if (this.get('step') === 'choose-card') {\r\n      return true;\r\n    }\r\n\r\n    //Going to appointment\r\n    if (targetRoute === 'appointments.book') {\r\n      return true;\r\n    }\r\n\r\n    //Have submitted\r\n    if (this.get('hasSubmitted')) {\r\n      return true;\r\n    }\r\n\r\n    //Not ok\r\n    return false;\r\n  }\r\n\r\n  //...\r\n});\r\n```\r\n\r\n**What did you expect to happen?**\r\n1) That my indentation remains as is, on account of my curly bracket starting at the beginning of the line.\r\n2) That if ESLInt fixes indentation, it actually also fixes the comments and not leave a garbled mess :)\r\n\r\n**What actually happened? Please include the actual, raw output from ESLint.**\r\nEverything has been indented, except for all the comments, leaving a bit of a mess:\r\n\r\n```js\r\nexport default FlowController.extend(\r\n  BookAppointment, ProcessOutcome, PreventNavigation,\r\n  {\r\n\r\n  //Nav model\r\n    navModel: Nav.create({\r\n      pageTitle: '...'\r\n    }),\r\n\r\n  //Model aliases\r\n    client: Ember.computed.reads('model.client'),\r\n    cards: Ember.computed.reads('model.cards'),\r\n\r\n  /**\r\n   * Ok to navigate away check\r\n   */\r\n    isOkToNavigateAway(targetRoute) {\r\n\r\n    //Still in first screen\r\n      if (this.get('step') === 'choose-card') {\r\n        return true;\r\n      }\r\n\r\n    //Going to appointment\r\n      if (targetRoute === 'appointments.book') {\r\n        return true;\r\n      }\r\n\r\n    //Have submitted\r\n      if (this.get('hasSubmitted')) {\r\n        return true;\r\n      }\r\n\r\n    //Not ok\r\n      return false;\r\n    }\r\n\r\n  //...\r\n  });\r\n```\r\n\r\nI don't know how issue 1 can be resolved. It's an annoying Ember pattern that you specify the object you're extending with as the last parameter, and I'd like to be able to have the indentation for that object start at the first position without ESLint trying to fix it.\r\n\r\nIssue 2 seems like a genuine bug. It should include comments when fixing indentation or it's just useless.\r\n"},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/254072329","html_url":"https://github.com/eslint/eslint/issues/6571#issuecomment-254072329","issue_url":"https://api.github.com/repos/eslint/eslint/issues/6571","id":254072329,"user":{"login":"adambuczynski","id":490562,"avatar_url":"https://avatars.githubusercontent.com/u/490562?v=3","gravatar_id":"","url":"https://api.github.com/users/adambuczynski","html_url":"https://github.com/adambuczynski","followers_url":"https://api.github.com/users/adambuczynski/followers","following_url":"https://api.github.com/users/adambuczynski/following{/other_user}","gists_url":"https://api.github.com/users/adambuczynski/gists{/gist_id}","starred_url":"https://api.github.com/users/adambuczynski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adambuczynski/subscriptions","organizations_url":"https://api.github.com/users/adambuczynski/orgs","repos_url":"https://api.github.com/users/adambuczynski/repos","events_url":"https://api.github.com/users/adambuczynski/events{/privacy}","received_events_url":"https://api.github.com/users/adambuczynski/received_events","type":"User","site_admin":false},"created_at":"2016-10-16T20:27:25Z","updated_at":"2016-10-16T20:27:25Z","body":"@platinumazure still the exact same behaviour with eslint 3.8.0"}}
{"actor":{"display_login":"adambuczynski"}}