{"action":"closed","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/10878","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/10878/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/10878/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/10878/events","html_url":"https://github.com/eslint/eslint/issues/10878","id":362231656,"node_id":"MDU6SXNzdWUzNjIyMzE2NTY=","number":10878,"title":"sort-imports rule fails to understand multiple import syntax","user":{"login":"paulbellamy","id":250199,"node_id":"MDQ6VXNlcjI1MDE5OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/250199?v=4","gravatar_id":"","url":"https://api.github.com/users/paulbellamy","html_url":"https://github.com/paulbellamy","followers_url":"https://api.github.com/users/paulbellamy/followers","following_url":"https://api.github.com/users/paulbellamy/following{/other_user}","gists_url":"https://api.github.com/users/paulbellamy/gists{/gist_id}","starred_url":"https://api.github.com/users/paulbellamy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulbellamy/subscriptions","organizations_url":"https://api.github.com/users/paulbellamy/orgs","repos_url":"https://api.github.com/users/paulbellamy/repos","events_url":"https://api.github.com/users/paulbellamy/events{/privacy}","received_events_url":"https://api.github.com/users/paulbellamy/received_events","type":"User","site_admin":false},"labels":[{"id":589339326,"node_id":"MDU6TGFiZWw1ODkzMzkzMjY=","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":3,"created_at":"2018-09-20T15:04:41Z","updated_at":"2018-10-02T00:50:40Z","closed_at":"2018-10-02T00:50:39Z","author_association":"NONE","body":"**Tell us about your environment**\r\n\r\n* **ESLint Version:** 5.6.0\r\n* **Node Version:** 8.9.4\r\n* **npm Version:** 5.6.0\r\n\r\n**What parser (default, Babel-ESLint, etc.) are you using?** babel-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  parser: \"babel-eslint\",\r\n  rules: {\r\n    \"sort-imports\": [\r\n      \"error\",\r\n      {\r\n        // this ordering matches one big, fully alphabetical group.\r\n        memberSyntaxSortOrder: [ \"none\", \"all\", \"single\", \"multiple\" ],\r\n      },\r\n    ],\r\n  },\r\n};\r\n```\r\n\r\n</details>\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\nimport Constants from \"./lib/constants\";\r\nimport { A } from \"a\";\r\nimport { B, C, D } from \"bcd\";\r\nimport { E } from \"e\";\r\n```\r\n\r\n<!-- Paste the command you used to run ESLint: -->\r\n```bash\r\n./node_modules/.bin/eslint foo.js\r\n```\r\n\r\n**What did you expect to happen?**\r\n\r\nIt to succeed, because:\r\n- All the \"single\" imports (`import Constant ...`) are before the \"multiple\" imports\r\n- All the \"multiple\"-syntax imports are sorted\r\n\r\n**What actually happened? Please include the actual, raw output from ESLint.**\r\n\r\n```\r\n$ ./node_modules/.bin/eslint foo.js\r\n\r\n/Users/paulbellamy/temp/eslinttest/foo.js\r\n  2:1  error  Imports should be sorted alphabetically            sort-imports\r\n  4:1  error  Expected 'single' syntax before 'multiple' syntax  sort-imports\r\n\r\n✖ 2 problems (2 errors, 0 warnings)\r\n```\r\n\r\nThe `sort-order` rule thinks that the correct ordering should be:\r\n\r\n```\r\nimport { A } from \"a\";\r\nimport Constants from \"./lib/constants\";\r\nimport { E } from \"e\";\r\nimport { B, C, D } from \"bcd\";\r\n```\r\n\r\nI believe the bug is that, when there is only one imported field in a \"multiple\" import syntax, the rule mis-groups it as a \"single\" import."}}
{"actor":{"display_login":"ilyavolodin"}}