{"action":"created","comment":{"url":"https://api.github.com/repos/prettier/prettier-atom/pulls/comments/108358459","pull_request_review_id":29382700,"id":108358459,"diff_hunk":"@@ -105,6 +125,11 @@ const getPrettierOptions = (editor: TextEditor) => ({\n   jsxBracketSameLine: getPrettierOption('jsxBracketSameLine'),\n });\n \n+const getPrettierCliOptions = (options: Object) =>\n+  Object.keys(options)\n+    .reduce((cliOptions, option) => [...cliOptions, `${CLI_OPTIONS[option]} ${options[option]}`], [])\n+    .join(' ');","path":"src/helpers.js","position":41,"original_position":41,"commit_id":"7b8c0b134d121c0a91c978cd8499ea818f390f07","original_commit_id":"7b8c0b134d121c0a91c978cd8499ea818f390f07","user":{"login":"charypar","id":1517854,"avatar_url":"https://avatars2.githubusercontent.com/u/1517854?v=3","gravatar_id":"","url":"https://api.github.com/users/charypar","html_url":"https://github.com/charypar","followers_url":"https://api.github.com/users/charypar/followers","following_url":"https://api.github.com/users/charypar/following{/other_user}","gists_url":"https://api.github.com/users/charypar/gists{/gist_id}","starred_url":"https://api.github.com/users/charypar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charypar/subscriptions","organizations_url":"https://api.github.com/users/charypar/orgs","repos_url":"https://api.github.com/users/charypar/repos","events_url":"https://api.github.com/users/charypar/events{/privacy}","received_events_url":"https://api.github.com/users/charypar/received_events","type":"User","site_admin":false},"body":"Ohh 🤦‍♂️  this is what happens when I write code in the evening. This used to concatenate strings like your second suggestion, that's why `reduce`, then I changed my mind to do an array and a join and didn't notice it's now just a map.\r\n\r\nHappy to change it to take `editor` instead of options.\r\n","created_at":"2017-03-28T08:12:21Z","updated_at":"2017-03-28T08:12:21Z","html_url":"https://github.com/prettier/prettier-atom/pull/104#discussion_r108358459","pull_request_url":"https://api.github.com/repos/prettier/prettier-atom/pulls/104","_links":{"self":{"href":"https://api.github.com/repos/prettier/prettier-atom/pulls/comments/108358459"},"html":{"href":"https://github.com/prettier/prettier-atom/pull/104#discussion_r108358459"},"pull_request":{"href":"https://api.github.com/repos/prettier/prettier-atom/pulls/104"}}},"pull_request":{"url":"https://api.github.com/repos/prettier/prettier-atom/pulls/104","id":112839388,"html_url":"https://github.com/prettier/prettier-atom/pull/104","diff_url":"https://github.com/prettier/prettier-atom/pull/104.diff","patch_url":"https://github.com/prettier/prettier-atom/pull/104.patch","issue_url":"https://api.github.com/repos/prettier/prettier-atom/issues/104","number":104,"state":"open","locked":false,"title":"Prefer local prettier over bundled version","user":{"login":"charypar","id":1517854,"avatar_url":"https://avatars2.githubusercontent.com/u/1517854?v=3","gravatar_id":"","url":"https://api.github.com/users/charypar","html_url":"https://github.com/charypar","followers_url":"https://api.github.com/users/charypar/followers","following_url":"https://api.github.com/users/charypar/following{/other_user}","gists_url":"https://api.github.com/users/charypar/gists{/gist_id}","starred_url":"https://api.github.com/users/charypar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charypar/subscriptions","organizations_url":"https://api.github.com/users/charypar/orgs","repos_url":"https://api.github.com/users/charypar/repos","events_url":"https://api.github.com/users/charypar/events{/privacy}","received_events_url":"https://api.github.com/users/charypar/received_events","type":"User","site_admin":false},"body":"Following on the conversation in #59, this is the first cut of the implementation.\r\n\r\nCalling prettier through the CLI works fine, but does introduce a short but noticeable lag (~300 ms on a MacBook Pro, so probably even more significant elsewhere). This is mentioned as a potential issue in https://github.com/prettier/prettier/issues/918. \r\n\r\n@robwise Is this a significant enough performance penalty to go back to dynamic require until jsonrpc or something similar is introduced in prettier?\r\n\r\nI still need to implement the configuration option requested in #43.\r\n\r\n# to do\r\n\r\n- [x] Prefer local prettier over bundled version\r\n- [ ] Add configuration to only use local prettier and do nothing if there isn't one","created_at":"2017-03-27T21:09:16Z","updated_at":"2017-03-28T08:12:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fda0e642fb8eddf6530a18e68498def8845f630d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/prettier/prettier-atom/pulls/104/commits","review_comments_url":"https://api.github.com/repos/prettier/prettier-atom/pulls/104/comments","review_comment_url":"https://api.github.com/repos/prettier/prettier-atom/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prettier/prettier-atom/issues/104/comments","statuses_url":"https://api.github.com/repos/prettier/prettier-atom/statuses/7b8c0b134d121c0a91c978cd8499ea818f390f07","head":{"label":"charypar:prefer-local-prettier","ref":"prefer-local-prettier","sha":"7b8c0b134d121c0a91c978cd8499ea818f390f07","user":{"login":"charypar","id":1517854,"avatar_url":"https://avatars2.githubusercontent.com/u/1517854?v=3","gravatar_id":"","url":"https://api.github.com/users/charypar","html_url":"https://github.com/charypar","followers_url":"https://api.github.com/users/charypar/followers","following_url":"https://api.github.com/users/charypar/following{/other_user}","gists_url":"https://api.github.com/users/charypar/gists{/gist_id}","starred_url":"https://api.github.com/users/charypar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charypar/subscriptions","organizations_url":"https://api.github.com/users/charypar/orgs","repos_url":"https://api.github.com/users/charypar/repos","events_url":"https://api.github.com/users/charypar/events{/privacy}","received_events_url":"https://api.github.com/users/charypar/received_events","type":"User","site_admin":false},"repo":{"id":85494545,"name":"prettier-atom","full_name":"charypar/prettier-atom","owner":{"login":"charypar","id":1517854,"avatar_url":"https://avatars2.githubusercontent.com/u/1517854?v=3","gravatar_id":"","url":"https://api.github.com/users/charypar","html_url":"https://github.com/charypar","followers_url":"https://api.github.com/users/charypar/followers","following_url":"https://api.github.com/users/charypar/following{/other_user}","gists_url":"https://api.github.com/users/charypar/gists{/gist_id}","starred_url":"https://api.github.com/users/charypar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charypar/subscriptions","organizations_url":"https://api.github.com/users/charypar/orgs","repos_url":"https://api.github.com/users/charypar/repos","events_url":"https://api.github.com/users/charypar/events{/privacy}","received_events_url":"https://api.github.com/users/charypar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/charypar/prettier-atom","description":"An atom package for the prettier formatter.","fork":true,"url":"https://api.github.com/repos/charypar/prettier-atom","forks_url":"https://api.github.com/repos/charypar/prettier-atom/forks","keys_url":"https://api.github.com/repos/charypar/prettier-atom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/charypar/prettier-atom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/charypar/prettier-atom/teams","hooks_url":"https://api.github.com/repos/charypar/prettier-atom/hooks","issue_events_url":"https://api.github.com/repos/charypar/prettier-atom/issues/events{/number}","events_url":"https://api.github.com/repos/charypar/prettier-atom/events","assignees_url":"https://api.github.com/repos/charypar/prettier-atom/assignees{/user}","branches_url":"https://api.github.com/repos/charypar/prettier-atom/branches{/branch}","tags_url":"https://api.github.com/repos/charypar/prettier-atom/tags","blobs_url":"https://api.github.com/repos/charypar/prettier-atom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/charypar/prettier-atom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/charypar/prettier-atom/git/refs{/sha}","trees_url":"https://api.github.com/repos/charypar/prettier-atom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/charypar/prettier-atom/statuses/{sha}","languages_url":"https://api.github.com/repos/charypar/prettier-atom/languages","stargazers_url":"https://api.github.com/repos/charypar/prettier-atom/stargazers","contributors_url":"https://api.github.com/repos/charypar/prettier-atom/contributors","subscribers_url":"https://api.github.com/repos/charypar/prettier-atom/subscribers","subscription_url":"https://api.github.com/repos/charypar/prettier-atom/subscription","commits_url":"https://api.github.com/repos/charypar/prettier-atom/commits{/sha}","git_commits_url":"https://api.github.com/repos/charypar/prettier-atom/git/commits{/sha}","comments_url":"https://api.github.com/repos/charypar/prettier-atom/comments{/number}","issue_comment_url":"https://api.github.com/repos/charypar/prettier-atom/issues/comments{/number}","contents_url":"https://api.github.com/repos/charypar/prettier-atom/contents/{+path}","compare_url":"https://api.github.com/repos/charypar/prettier-atom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/charypar/prettier-atom/merges","archive_url":"https://api.github.com/repos/charypar/prettier-atom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/charypar/prettier-atom/downloads","issues_url":"https://api.github.com/repos/charypar/prettier-atom/issues{/number}","pulls_url":"https://api.github.com/repos/charypar/prettier-atom/pulls{/number}","milestones_url":"https://api.github.com/repos/charypar/prettier-atom/milestones{/number}","notifications_url":"https://api.github.com/repos/charypar/prettier-atom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/charypar/prettier-atom/labels{/name}","releases_url":"https://api.github.com/repos/charypar/prettier-atom/releases{/id}","deployments_url":"https://api.github.com/repos/charypar/prettier-atom/deployments","created_at":"2017-03-19T17:16:53Z","updated_at":"2017-03-19T17:16:55Z","pushed_at":"2017-03-27T21:02:31Z","git_url":"git://github.com/charypar/prettier-atom.git","ssh_url":"git@github.com:charypar/prettier-atom.git","clone_url":"https://github.com/charypar/prettier-atom.git","svn_url":"https://github.com/charypar/prettier-atom","homepage":null,"size":759,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"prettier:master","ref":"master","sha":"ffef4cc5073231dcedab69de829db53e8815957a","user":{"login":"prettier","id":25822731,"avatar_url":"https://avatars1.githubusercontent.com/u/25822731?v=3","gravatar_id":"","url":"https://api.github.com/users/prettier","html_url":"https://github.com/prettier","followers_url":"https://api.github.com/users/prettier/followers","following_url":"https://api.github.com/users/prettier/following{/other_user}","gists_url":"https://api.github.com/users/prettier/gists{/gist_id}","starred_url":"https://api.github.com/users/prettier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prettier/subscriptions","organizations_url":"https://api.github.com/users/prettier/orgs","repos_url":"https://api.github.com/users/prettier/repos","events_url":"https://api.github.com/users/prettier/events{/privacy}","received_events_url":"https://api.github.com/users/prettier/received_events","type":"Organization","site_admin":false},"repo":{"id":78498562,"name":"prettier-atom","full_name":"prettier/prettier-atom","owner":{"login":"prettier","id":25822731,"avatar_url":"https://avatars1.githubusercontent.com/u/25822731?v=3","gravatar_id":"","url":"https://api.github.com/users/prettier","html_url":"https://github.com/prettier","followers_url":"https://api.github.com/users/prettier/followers","following_url":"https://api.github.com/users/prettier/following{/other_user}","gists_url":"https://api.github.com/users/prettier/gists{/gist_id}","starred_url":"https://api.github.com/users/prettier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prettier/subscriptions","organizations_url":"https://api.github.com/users/prettier/orgs","repos_url":"https://api.github.com/users/prettier/repos","events_url":"https://api.github.com/users/prettier/events{/privacy}","received_events_url":"https://api.github.com/users/prettier/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prettier/prettier-atom","description":"An atom package for the prettier formatter.","fork":false,"url":"https://api.github.com/repos/prettier/prettier-atom","forks_url":"https://api.github.com/repos/prettier/prettier-atom/forks","keys_url":"https://api.github.com/repos/prettier/prettier-atom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prettier/prettier-atom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prettier/prettier-atom/teams","hooks_url":"https://api.github.com/repos/prettier/prettier-atom/hooks","issue_events_url":"https://api.github.com/repos/prettier/prettier-atom/issues/events{/number}","events_url":"https://api.github.com/repos/prettier/prettier-atom/events","assignees_url":"https://api.github.com/repos/prettier/prettier-atom/assignees{/user}","branches_url":"https://api.github.com/repos/prettier/prettier-atom/branches{/branch}","tags_url":"https://api.github.com/repos/prettier/prettier-atom/tags","blobs_url":"https://api.github.com/repos/prettier/prettier-atom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prettier/prettier-atom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prettier/prettier-atom/git/refs{/sha}","trees_url":"https://api.github.com/repos/prettier/prettier-atom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prettier/prettier-atom/statuses/{sha}","languages_url":"https://api.github.com/repos/prettier/prettier-atom/languages","stargazers_url":"https://api.github.com/repos/prettier/prettier-atom/stargazers","contributors_url":"https://api.github.com/repos/prettier/prettier-atom/contributors","subscribers_url":"https://api.github.com/repos/prettier/prettier-atom/subscribers","subscription_url":"https://api.github.com/repos/prettier/prettier-atom/subscription","commits_url":"https://api.github.com/repos/prettier/prettier-atom/commits{/sha}","git_commits_url":"https://api.github.com/repos/prettier/prettier-atom/git/commits{/sha}","comments_url":"https://api.github.com/repos/prettier/prettier-atom/comments{/number}","issue_comment_url":"https://api.github.com/repos/prettier/prettier-atom/issues/comments{/number}","contents_url":"https://api.github.com/repos/prettier/prettier-atom/contents/{+path}","compare_url":"https://api.github.com/repos/prettier/prettier-atom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prettier/prettier-atom/merges","archive_url":"https://api.github.com/repos/prettier/prettier-atom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prettier/prettier-atom/downloads","issues_url":"https://api.github.com/repos/prettier/prettier-atom/issues{/number}","pulls_url":"https://api.github.com/repos/prettier/prettier-atom/pulls{/number}","milestones_url":"https://api.github.com/repos/prettier/prettier-atom/milestones{/number}","notifications_url":"https://api.github.com/repos/prettier/prettier-atom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prettier/prettier-atom/labels{/name}","releases_url":"https://api.github.com/repos/prettier/prettier-atom/releases{/id}","deployments_url":"https://api.github.com/repos/prettier/prettier-atom/deployments","created_at":"2017-01-10T04:47:01Z","updated_at":"2017-03-27T13:05:32Z","pushed_at":"2017-03-27T21:09:17Z","git_url":"git://github.com/prettier/prettier-atom.git","ssh_url":"git@github.com:prettier/prettier-atom.git","clone_url":"https://github.com/prettier/prettier-atom.git","svn_url":"https://github.com/prettier/prettier-atom","homepage":null,"size":872,"stargazers_count":117,"watchers_count":117,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":13,"forks":25,"open_issues":13,"watchers":117,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prettier/prettier-atom/pulls/104"},"html":{"href":"https://github.com/prettier/prettier-atom/pull/104"},"issue":{"href":"https://api.github.com/repos/prettier/prettier-atom/issues/104"},"comments":{"href":"https://api.github.com/repos/prettier/prettier-atom/issues/104/comments"},"review_comments":{"href":"https://api.github.com/repos/prettier/prettier-atom/pulls/104/comments"},"review_comment":{"href":"https://api.github.com/repos/prettier/prettier-atom/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prettier/prettier-atom/pulls/104/commits"},"statuses":{"href":"https://api.github.com/repos/prettier/prettier-atom/statuses/7b8c0b134d121c0a91c978cd8499ea818f390f07"}}}}
{"actor":{"display_login":"charypar"}}