{"action":"closed","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/9138","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/9138/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/9138/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/9138/events","html_url":"https://github.com/eslint/eslint/issues/9138","id":251922091,"number":9138,"title":"Incosistent newline-per-chained-call rule ","user":{"login":"xamoom-pali","id":11027796,"avatar_url":"https://avatars2.githubusercontent.com/u/11027796?v=4","gravatar_id":"","url":"https://api.github.com/users/xamoom-pali","html_url":"https://github.com/xamoom-pali","followers_url":"https://api.github.com/users/xamoom-pali/followers","following_url":"https://api.github.com/users/xamoom-pali/following{/other_user}","gists_url":"https://api.github.com/users/xamoom-pali/gists{/gist_id}","starred_url":"https://api.github.com/users/xamoom-pali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xamoom-pali/subscriptions","organizations_url":"https://api.github.com/users/xamoom-pali/orgs","repos_url":"https://api.github.com/users/xamoom-pali/repos","events_url":"https://api.github.com/users/xamoom-pali/events{/privacy}","received_events_url":"https://api.github.com/users/xamoom-pali/received_events","type":"User","site_admin":false},"labels":[{"id":589339326,"url":"https://api.github.com/repos/eslint/eslint/labels/works%20as%20intended","name":"works as intended","color":"dddddd","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-08-22T11:15:48Z","updated_at":"2017-08-23T08:00:30Z","closed_at":"2017-08-23T08:00:30Z","body":"* ESLint Version: v4.4.1\r\n* Node Version: v6.0.0\r\n* npm Version: v3.8.6\r\n\r\n**What parser (default, Babel-ESLint, etc.) are you using?**\r\neslint / ember-cli-eslint\r\n\r\n**Please show your full configuration:**\r\n\r\n<details>\r\n<summary>Configuration</summary>\r\n\r\n<!-- Paste your configuration below: -->\r\n```js\r\nmodule.exports = {\r\n  root: true,\r\n  parserOptions: {\r\n    ecmaVersion: 2017,\r\n    sourceType: 'module'\r\n  },\r\n  extends: [\r\n    'airbnb-base',\r\n    'plugin:ember/recommended'\r\n  ],\r\n  env: {\r\n    browser: true,\r\n  },\r\n  rules: {\r\n    \"ember/named-functions-in-promises\": \"off\",\r\n    \"ember/no-observers\": \"off\"\r\n  },\r\n  settings: {\r\n\r\n    'import/core-modules': [\r\n      './config/environment',\r\n      'ember',\r\n      'ember-load-initializers',\r\n      'ember-resolver',\r\n      'ember-data/model',\r\n      'ember-data/attr',\r\n      'ember-data/relationships',\r\n      'ember-data/serializers/json-api',\r\n      'ember-data/-private/transforms/string',\r\n      'ember-cp-validations',\r\n      'ember-cp-validations/validators/base',\r\n      'ember-cp-validations/validators/format',\r\n      'ember-simple-auth/mixins/authenticated-route-mixin',\r\n      'ember-simple-auth/mixins/data-adapter-mixin',\r\n      'ember-simple-auth/authenticators/oauth2-password-grant',\r\n      'ember-simple-auth/authorizers/base',\r\n      'ember-moment/computeds/moment',\r\n      'ember-moment/computeds/format',\r\n      'ember-moment/computeds/locale',\r\n      'model-fragments',\r\n      'model-fragments/attributes'\r\n    ],\r\n  },\r\n};\r\n\r\n```\r\n</details>\r\n\r\n\r\n**What did you do? Please include the actual source code causing the issue.**\r\nI am getting ESlint errors in a somehow inconsistent way.\r\nThere are 2 functions. One of them is analysed as correct, while the second one is marked\r\nas problematic. \r\n\r\nSee the ESlint complaint below.\r\n\r\n<!-- Paste the source code below: -->\r\n```js\r\n\r\n     // this function is not correct according to ESlint\r\n    _doSave() {\r\n      this.indicateProcessStart();\r\n\r\n      this._updateRemovedLocalizedInfos()\r\n        .then(() => {\r\n          return this._updateDirtyLocalizedInfos();\r\n        }).then(() => {\r\n          return this._updateSystem();\r\n        }).then((system) => {\r\n          set(this, 'initialLocalizedSystemInfosLength', get(system, 'localizedSystemInfos.length'));\r\n          this.send('success', get(this, 'i18n').t('components.alert.success').toString());\r\n        }).catch((error) => { // <---- complaint here\r\n          this.send('error', error);\r\n        }).finally(() => { // <---- complaint here\r\n          this.indicateProcessCompletion();\r\n        });\r\n    },\r\n\r\n    // this function is correct according to ESlint while using .catch() in a very same way. Why?\r\n    _updateDirtyLocalizedInfos() {\r\n      return new Ember.RSVP.Promise((resolve) => {\r\n        const dirtyLocalizedSystemInfos = A();\r\n        ...\r\n\r\n        const updateNextLSI = function () {\r\n          if (isEmpty(dirtyLocalizedSystemInfos)) {\r\n            resolve();\r\n            return;\r\n          }\r\n\r\n          const lsiToBeUpdated = dirtyLocalizedSystemInfos.objectAt(0);\r\n\r\n          lsiToBeUpdated.save()\r\n            .then(() => {\r\n              dirtyLocalizedSystemInfos.removeObject(lsiToBeUpdated);\r\n              updateNextLSI();\r\n            }).catch((e) => {  // <---- ESlint not complaining here. Why?\r\n              dirtyLocalizedSystemInfos.removeObject(lsiToBeUpdated);\r\n              updateNextLSI();\r\n            });\r\n        };\r\n\r\n        updateNextLSI();\r\n      });\r\n    },\r\n\r\n```\r\n\r\n**What did you expect to happen?**\r\nI expect ESlint either complain in both cases or not complain at all.\r\n\r\n**What actually happened? Please include the actual, raw output from ESLint.**\r\n```\r\n[eslint] Expected line break before `.catch`. (newline-per-chained-call)\r\n```\r\nAm I missing anything here or is it a bug with ESlint rule itself? Thank you"}}
{"actor":{"display_login":"xamoom-pali"}}