{"action":"closed","number":1144,"pull_request":{"url":"https://api.github.com/repos/prettier/prettier/pulls/1144","id":114694887,"html_url":"https://github.com/prettier/prettier/pull/1144","diff_url":"https://github.com/prettier/prettier/pull/1144.diff","patch_url":"https://github.com/prettier/prettier/pull/1144.patch","issue_url":"https://api.github.com/repos/prettier/prettier/issues/1144","number":1144,"state":"closed","locked":false,"title":"Improve jsx output for style components","user":{"login":"vjeux","id":197597,"avatar_url":"https://avatars3.githubusercontent.com/u/197597?v=3","gravatar_id":"","url":"https://api.github.com/users/vjeux","html_url":"https://github.com/vjeux","followers_url":"https://api.github.com/users/vjeux/followers","following_url":"https://api.github.com/users/vjeux/following{/other_user}","gists_url":"https://api.github.com/users/vjeux/gists{/gist_id}","starred_url":"https://api.github.com/users/vjeux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vjeux/subscriptions","organizations_url":"https://api.github.com/users/vjeux/orgs","repos_url":"https://api.github.com/users/vjeux/repos","events_url":"https://api.github.com/users/vjeux/events{/privacy}","received_events_url":"https://api.github.com/users/vjeux/received_events","type":"User","site_admin":false},"body":"There are two commits in this PR:\r\n\r\n## Hug template literals inside of JSXExpressionContainer\r\nWe already hug a bunch of things inside of `{}`. It seems that it's a good idea to do it for template literals as well. I don't think I've seen anyone actually indent them.\r\n\r\n## Inline jsx elements with single template literal expression\r\n\r\nIf there is a single expression and a single template literal, then a lot of people in the jsx-style world inline it. I've also myself used this for markdown and printed it that way. So we probably should print it that way.\r\n\r\nNote that I'm checking for children.length === 1, this means that if there's any whitespace, this is not going to be true and will not enter this case. So it WON'T reformat\r\n\r\n```js\r\n<style>\r\n  {`\r\n     color: red;\r\n  `}\r\n</style>\r\n```\r\n\r\ninto\r\n\r\n```js\r\n<style>{`\r\n    color: red;\r\n`}</style>\r\n```\r\n\r\nwhich is great. You have to opt-in to the second style in order to get it.\r\n\r\n\r\nFixes for #1090","created_at":"2017-04-06T21:04:24Z","updated_at":"2017-04-11T16:33:03Z","closed_at":"2017-04-11T16:33:03Z","merged_at":"2017-04-11T16:33:03Z","merge_commit_sha":"b6edf96cc49b0cd7f32d0ce82f779881afe966ef","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/prettier/prettier/pulls/1144/commits","review_comments_url":"https://api.github.com/repos/prettier/prettier/pulls/1144/comments","review_comment_url":"https://api.github.com/repos/prettier/prettier/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prettier/prettier/issues/1144/comments","statuses_url":"https://api.github.com/repos/prettier/prettier/statuses/29683765bcec3269ebeb183676892942648470ae","head":{"label":"vjeux:jsx_template","ref":"jsx_template","sha":"29683765bcec3269ebeb183676892942648470ae","user":{"login":"vjeux","id":197597,"avatar_url":"https://avatars3.githubusercontent.com/u/197597?v=3","gravatar_id":"","url":"https://api.github.com/users/vjeux","html_url":"https://github.com/vjeux","followers_url":"https://api.github.com/users/vjeux/followers","following_url":"https://api.github.com/users/vjeux/following{/other_user}","gists_url":"https://api.github.com/users/vjeux/gists{/gist_id}","starred_url":"https://api.github.com/users/vjeux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vjeux/subscriptions","organizations_url":"https://api.github.com/users/vjeux/orgs","repos_url":"https://api.github.com/users/vjeux/repos","events_url":"https://api.github.com/users/vjeux/events{/privacy}","received_events_url":"https://api.github.com/users/vjeux/received_events","type":"User","site_admin":false},"repo":{"id":78607707,"name":"prettier","full_name":"vjeux/prettier","owner":{"login":"vjeux","id":197597,"avatar_url":"https://avatars3.githubusercontent.com/u/197597?v=3","gravatar_id":"","url":"https://api.github.com/users/vjeux","html_url":"https://github.com/vjeux","followers_url":"https://api.github.com/users/vjeux/followers","following_url":"https://api.github.com/users/vjeux/following{/other_user}","gists_url":"https://api.github.com/users/vjeux/gists{/gist_id}","starred_url":"https://api.github.com/users/vjeux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vjeux/subscriptions","organizations_url":"https://api.github.com/users/vjeux/orgs","repos_url":"https://api.github.com/users/vjeux/repos","events_url":"https://api.github.com/users/vjeux/events{/privacy}","received_events_url":"https://api.github.com/users/vjeux/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vjeux/prettier","description":"Prettier is an opinionated JavaScript formatter.","fork":true,"url":"https://api.github.com/repos/vjeux/prettier","forks_url":"https://api.github.com/repos/vjeux/prettier/forks","keys_url":"https://api.github.com/repos/vjeux/prettier/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vjeux/prettier/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vjeux/prettier/teams","hooks_url":"https://api.github.com/repos/vjeux/prettier/hooks","issue_events_url":"https://api.github.com/repos/vjeux/prettier/issues/events{/number}","events_url":"https://api.github.com/repos/vjeux/prettier/events","assignees_url":"https://api.github.com/repos/vjeux/prettier/assignees{/user}","branches_url":"https://api.github.com/repos/vjeux/prettier/branches{/branch}","tags_url":"https://api.github.com/repos/vjeux/prettier/tags","blobs_url":"https://api.github.com/repos/vjeux/prettier/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vjeux/prettier/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vjeux/prettier/git/refs{/sha}","trees_url":"https://api.github.com/repos/vjeux/prettier/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vjeux/prettier/statuses/{sha}","languages_url":"https://api.github.com/repos/vjeux/prettier/languages","stargazers_url":"https://api.github.com/repos/vjeux/prettier/stargazers","contributors_url":"https://api.github.com/repos/vjeux/prettier/contributors","subscribers_url":"https://api.github.com/repos/vjeux/prettier/subscribers","subscription_url":"https://api.github.com/repos/vjeux/prettier/subscription","commits_url":"https://api.github.com/repos/vjeux/prettier/commits{/sha}","git_commits_url":"https://api.github.com/repos/vjeux/prettier/git/commits{/sha}","comments_url":"https://api.github.com/repos/vjeux/prettier/comments{/number}","issue_comment_url":"https://api.github.com/repos/vjeux/prettier/issues/comments{/number}","contents_url":"https://api.github.com/repos/vjeux/prettier/contents/{+path}","compare_url":"https://api.github.com/repos/vjeux/prettier/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vjeux/prettier/merges","archive_url":"https://api.github.com/repos/vjeux/prettier/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vjeux/prettier/downloads","issues_url":"https://api.github.com/repos/vjeux/prettier/issues{/number}","pulls_url":"https://api.github.com/repos/vjeux/prettier/pulls{/number}","milestones_url":"https://api.github.com/repos/vjeux/prettier/milestones{/number}","notifications_url":"https://api.github.com/repos/vjeux/prettier/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vjeux/prettier/labels{/name}","releases_url":"https://api.github.com/repos/vjeux/prettier/releases{/id}","deployments_url":"https://api.github.com/repos/vjeux/prettier/deployments","created_at":"2017-01-11T05:59:58Z","updated_at":"2017-01-11T06:00:02Z","pushed_at":"2017-04-11T16:25:26Z","git_url":"git://github.com/vjeux/prettier.git","ssh_url":"git@github.com:vjeux/prettier.git","clone_url":"https://github.com/vjeux/prettier.git","svn_url":"https://github.com/vjeux/prettier","homepage":"","size":9002,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"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":"636d1af19e3b0e8670b3cc35aeb85e53361ffdba","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":75104123,"name":"prettier","full_name":"prettier/prettier","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","description":"Prettier is an opinionated JavaScript formatter.","fork":false,"url":"https://api.github.com/repos/prettier/prettier","forks_url":"https://api.github.com/repos/prettier/prettier/forks","keys_url":"https://api.github.com/repos/prettier/prettier/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prettier/prettier/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prettier/prettier/teams","hooks_url":"https://api.github.com/repos/prettier/prettier/hooks","issue_events_url":"https://api.github.com/repos/prettier/prettier/issues/events{/number}","events_url":"https://api.github.com/repos/prettier/prettier/events","assignees_url":"https://api.github.com/repos/prettier/prettier/assignees{/user}","branches_url":"https://api.github.com/repos/prettier/prettier/branches{/branch}","tags_url":"https://api.github.com/repos/prettier/prettier/tags","blobs_url":"https://api.github.com/repos/prettier/prettier/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prettier/prettier/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prettier/prettier/git/refs{/sha}","trees_url":"https://api.github.com/repos/prettier/prettier/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prettier/prettier/statuses/{sha}","languages_url":"https://api.github.com/repos/prettier/prettier/languages","stargazers_url":"https://api.github.com/repos/prettier/prettier/stargazers","contributors_url":"https://api.github.com/repos/prettier/prettier/contributors","subscribers_url":"https://api.github.com/repos/prettier/prettier/subscribers","subscription_url":"https://api.github.com/repos/prettier/prettier/subscription","commits_url":"https://api.github.com/repos/prettier/prettier/commits{/sha}","git_commits_url":"https://api.github.com/repos/prettier/prettier/git/commits{/sha}","comments_url":"https://api.github.com/repos/prettier/prettier/comments{/number}","issue_comment_url":"https://api.github.com/repos/prettier/prettier/issues/comments{/number}","contents_url":"https://api.github.com/repos/prettier/prettier/contents/{+path}","compare_url":"https://api.github.com/repos/prettier/prettier/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prettier/prettier/merges","archive_url":"https://api.github.com/repos/prettier/prettier/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prettier/prettier/downloads","issues_url":"https://api.github.com/repos/prettier/prettier/issues{/number}","pulls_url":"https://api.github.com/repos/prettier/prettier/pulls{/number}","milestones_url":"https://api.github.com/repos/prettier/prettier/milestones{/number}","notifications_url":"https://api.github.com/repos/prettier/prettier/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prettier/prettier/labels{/name}","releases_url":"https://api.github.com/repos/prettier/prettier/releases{/id}","deployments_url":"https://api.github.com/repos/prettier/prettier/deployments","created_at":"2016-11-29T17:13:37Z","updated_at":"2017-04-11T16:29:35Z","pushed_at":"2017-04-11T16:33:03Z","git_url":"git://github.com/prettier/prettier.git","ssh_url":"git@github.com:prettier/prettier.git","clone_url":"https://github.com/prettier/prettier.git","svn_url":"https://github.com/prettier/prettier","homepage":"https://prettier.github.io/prettier/","size":8317,"stargazers_count":6871,"watchers_count":6871,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":224,"mirror_url":null,"open_issues_count":103,"forks":224,"open_issues":103,"watchers":6871,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prettier/prettier/pulls/1144"},"html":{"href":"https://github.com/prettier/prettier/pull/1144"},"issue":{"href":"https://api.github.com/repos/prettier/prettier/issues/1144"},"comments":{"href":"https://api.github.com/repos/prettier/prettier/issues/1144/comments"},"review_comments":{"href":"https://api.github.com/repos/prettier/prettier/pulls/1144/comments"},"review_comment":{"href":"https://api.github.com/repos/prettier/prettier/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prettier/prettier/pulls/1144/commits"},"statuses":{"href":"https://api.github.com/repos/prettier/prettier/statuses/29683765bcec3269ebeb183676892942648470ae"}},"merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"vjeux","id":197597,"avatar_url":"https://avatars3.githubusercontent.com/u/197597?v=3","gravatar_id":"","url":"https://api.github.com/users/vjeux","html_url":"https://github.com/vjeux","followers_url":"https://api.github.com/users/vjeux/followers","following_url":"https://api.github.com/users/vjeux/following{/other_user}","gists_url":"https://api.github.com/users/vjeux/gists{/gist_id}","starred_url":"https://api.github.com/users/vjeux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vjeux/subscriptions","organizations_url":"https://api.github.com/users/vjeux/orgs","repos_url":"https://api.github.com/users/vjeux/repos","events_url":"https://api.github.com/users/vjeux/events{/privacy}","received_events_url":"https://api.github.com/users/vjeux/received_events","type":"User","site_admin":false},"comments":2,"review_comments":3,"maintainer_can_modify":false,"commits":2,"additions":79,"deletions":3,"changed_files":4}}
{"actor":{"display_login":"vjeux"}}