{"action":"created","issue":{"url":"https://api.github.com/repos/prettier/prettier/issues/1389","repository_url":"https://api.github.com/repos/prettier/prettier","labels_url":"https://api.github.com/repos/prettier/prettier/issues/1389/labels{/name}","comments_url":"https://api.github.com/repos/prettier/prettier/issues/1389/comments","events_url":"https://api.github.com/repos/prettier/prettier/issues/1389/events","html_url":"https://github.com/prettier/prettier/issues/1389","id":223553515,"number":1389,"title":"Odd printing of parentheses around single rest parameter","user":{"login":"SoullessWaffle","id":5085260,"avatar_url":"https://avatars2.githubusercontent.com/u/5085260?v=3","gravatar_id":"","url":"https://api.github.com/users/SoullessWaffle","html_url":"https://github.com/SoullessWaffle","followers_url":"https://api.github.com/users/SoullessWaffle/followers","following_url":"https://api.github.com/users/SoullessWaffle/following{/other_user}","gists_url":"https://api.github.com/users/SoullessWaffle/gists{/gist_id}","starred_url":"https://api.github.com/users/SoullessWaffle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SoullessWaffle/subscriptions","organizations_url":"https://api.github.com/users/SoullessWaffle/orgs","repos_url":"https://api.github.com/users/SoullessWaffle/repos","events_url":"https://api.github.com/users/SoullessWaffle/events{/privacy}","received_events_url":"https://api.github.com/users/SoullessWaffle/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-22T09:49:45Z","updated_at":"2017-04-22T11:21:00Z","closed_at":null,"body":"Tested with Prettier v1.2.2 on github.io with print width 80 and all settings at their defaults.\r\n\r\nInput:\r\n```js\r\nconst foobar = (argumentOne, argumentTwo, argumentThree) =>\r\n  (...restOfTheArguments) => {\r\n    return \"baz\";\r\n  };\r\n```\r\n\r\nOutput:\r\n```js\r\nconst foobar = (argumentOne, argumentTwo, argumentThree) => (\r\n  ...restOfTheArguments\r\n) => {\r\n  return \"baz\";\r\n};\r\n```\r\n\r\nMaybe it's just me, but that output looks a little off.\r\nEspecially when compared to the output of this same-length non-rest parameter expression:\r\n\r\nInput:\r\n```js\r\nconst foobar = (argumentOne, argumentTwo, argumentThree) =>\r\n  (restOfTheArguments123) => {\r\n    return \"baz\";\r\n  };\r\n```\r\n\r\nOutput:\r\n```js\r\nconst foobar = (\r\n  argumentOne,\r\n  argumentTwo,\r\n  argumentThree\r\n) => restOfTheArguments123 => {\r\n  return \"baz\";\r\n};\r\n```\r\n\r\nSince you can't remove the parentheses, the next best solution could be to have the parentheses hug the rest parameter to try to make sure they stay on the same line."},"comment":{"url":"https://api.github.com/repos/prettier/prettier/issues/comments/296366625","html_url":"https://github.com/prettier/prettier/issues/1389#issuecomment-296366625","issue_url":"https://api.github.com/repos/prettier/prettier/issues/1389","id":296366625,"user":{"login":"xixixao","id":1473433,"avatar_url":"https://avatars1.githubusercontent.com/u/1473433?v=3","gravatar_id":"","url":"https://api.github.com/users/xixixao","html_url":"https://github.com/xixixao","followers_url":"https://api.github.com/users/xixixao/followers","following_url":"https://api.github.com/users/xixixao/following{/other_user}","gists_url":"https://api.github.com/users/xixixao/gists{/gist_id}","starred_url":"https://api.github.com/users/xixixao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xixixao/subscriptions","organizations_url":"https://api.github.com/users/xixixao/orgs","repos_url":"https://api.github.com/users/xixixao/repos","events_url":"https://api.github.com/users/xixixao/events{/privacy}","received_events_url":"https://api.github.com/users/xixixao/received_events","type":"User","site_admin":false},"created_at":"2017-04-22T11:21:00Z","updated_at":"2017-04-22T11:21:00Z","body":"@SoullessWaffle This is does follow the current logic, notice what happens when you add second argument to the second arrow function in your second example:\r\nInput:\r\n```es6\r\nconst foobar = (argumentOne, argumentTwo, argumentThree) =>\r\n  (restOfTheArguments123, j) => {\r\n    return \"baz\";\r\n  };\r\n```\r\nOutput:\r\n```es6\r\nconst foobar = (argumentOne, argumentTwo, argumentThree) => (\r\n  restOfTheArguments123,\r\n  j\r\n) => {\r\n  return \"baz\";\r\n};\r\n```\r\n\r\nAnd the same happens when you add annotation to a single argument.\r\nInput:\r\n\r\n```es6\r\nconst foobar = (argumentOne, argumentTwo, argumentThree) =>\r\n  (restOfTheArguments123: number) => {\r\n    return \"baz\";\r\n  };\r\n```\r\nOutput:\r\n```es6\r\nconst foobar = (argumentOne, argumentTwo, argumentThree) => (\r\n  restOfTheArguments123: number\r\n) => {\r\n  return \"baz\";\r\n};\r\n```\r\nThat said, I do find the inputs more readable than the outputs, but not sure what repercussions changing this would have. This is definitely not specific to the use of rest argument though.\r\n"}}
{"actor":{"display_login":"xixixao"}}