{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/kibana/pulls/comments/79214012","id":79214012,"diff_hunk":"@@ -344,92 +476,69 @@ if (a == '') {\n \n ## Only use ternary operators for small, simple code\n \n-And **never** use multiple ternaries together\n-\n-*Right:*\n+And *never* use multiple ternaries together\n \n ```js\n-var foo = (a === b) ? 1 : 2;\n-```\n-\n-*Wrong:*\n+// good\n+const foo = (a === b) ? 1 : 2;","path":"style_guides/js_style_guide.md","position":604,"original_position":604,"commit_id":"b0fca9083dad2ffe10ef0bd774350f905c027ab0","original_commit_id":"b0fca9083dad2ffe10ef0bd774350f905c027ab0","user":{"login":"cjcenizal","id":1238659,"avatar_url":"https://avatars.githubusercontent.com/u/1238659?v=3","gravatar_id":"","url":"https://api.github.com/users/cjcenizal","html_url":"https://github.com/cjcenizal","followers_url":"https://api.github.com/users/cjcenizal/followers","following_url":"https://api.github.com/users/cjcenizal/following{/other_user}","gists_url":"https://api.github.com/users/cjcenizal/gists{/gist_id}","starred_url":"https://api.github.com/users/cjcenizal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjcenizal/subscriptions","organizations_url":"https://api.github.com/users/cjcenizal/orgs","repos_url":"https://api.github.com/users/cjcenizal/repos","events_url":"https://api.github.com/users/cjcenizal/events{/privacy}","received_events_url":"https://api.github.com/users/cjcenizal/received_events","type":"User","site_admin":false},"body":"This example needs to be fleshed out to act as a true alternative to the \"bad\" example:\r\n\r\n```javascript\r\nlet foo;\r\n\r\nswitch (a) {\r\n  case b:\r\n    foo = 1;\r\n    break;\r\n  case c:\r\n    foo = 2;\r\n    break;\r\n  default:\r\n    foo = 3;\r\n}\r\n```","created_at":"2016-09-16T17:26:02Z","updated_at":"2016-09-16T17:43:11Z","html_url":"https://github.com/elastic/kibana/pull/7435#discussion_r79214012","pull_request_url":"https://api.github.com/repos/elastic/kibana/pulls/7435","_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments/79214012"},"html":{"href":"https://github.com/elastic/kibana/pull/7435#discussion_r79214012"},"pull_request":{"href":"https://api.github.com/repos/elastic/kibana/pulls/7435"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/kibana/pulls/7435","id":73497666,"html_url":"https://github.com/elastic/kibana/pull/7435","diff_url":"https://github.com/elastic/kibana/pull/7435.diff","patch_url":"https://github.com/elastic/kibana/pull/7435.patch","issue_url":"https://api.github.com/repos/elastic/kibana/issues/7435","number":7435,"state":"open","locked":false,"title":"Current styleguide conventions with modern JS","user":{"login":"epixa","id":53814,"avatar_url":"https://avatars.githubusercontent.com/u/53814?v=3","gravatar_id":"","url":"https://api.github.com/users/epixa","html_url":"https://github.com/epixa","followers_url":"https://api.github.com/users/epixa/followers","following_url":"https://api.github.com/users/epixa/following{/other_user}","gists_url":"https://api.github.com/users/epixa/gists{/gist_id}","starred_url":"https://api.github.com/users/epixa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epixa/subscriptions","organizations_url":"https://api.github.com/users/epixa/orgs","repos_url":"https://api.github.com/users/epixa/repos","events_url":"https://api.github.com/users/epixa/events{/privacy}","received_events_url":"https://api.github.com/users/epixa/received_events","type":"User","site_admin":false},"body":"The existing styleguide was in great need of a rewrite as it did not\r\nreflect the conventions we're using in the codebase or even the best\r\npractices that we follow. In some cases, the guidance it provided was\r\noutright contrary to our current practices.\r\n\r\n**For reviewers:** For the most part, I recommend just looking directly\r\nat the updated styleguide and reviewing it as if it were a new document\r\nrather than trying to make sense of this diff.\r\n\r\nThis document really needs to be reorganized with jump links as well,\r\nbut for this first pass, please just review the content itself.  We can\r\nfollow up with an additional PR that reorganizes everything.\r\n\r\nLink directly to JS styleguide from this branch: https://github.com/epixa/kibana/blob/styleguide/style_guides/js_style_guide.md","created_at":"2016-06-12T14:30:30Z","updated_at":"2016-09-16T17:43:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"066f504622fe9226da4e333531958bae78843051","assignee":{"login":"cjcenizal","id":1238659,"avatar_url":"https://avatars.githubusercontent.com/u/1238659?v=3","gravatar_id":"","url":"https://api.github.com/users/cjcenizal","html_url":"https://github.com/cjcenizal","followers_url":"https://api.github.com/users/cjcenizal/followers","following_url":"https://api.github.com/users/cjcenizal/following{/other_user}","gists_url":"https://api.github.com/users/cjcenizal/gists{/gist_id}","starred_url":"https://api.github.com/users/cjcenizal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjcenizal/subscriptions","organizations_url":"https://api.github.com/users/cjcenizal/orgs","repos_url":"https://api.github.com/users/cjcenizal/repos","events_url":"https://api.github.com/users/cjcenizal/events{/privacy}","received_events_url":"https://api.github.com/users/cjcenizal/received_events","type":"User","site_admin":false},"assignees":[{"login":"cjcenizal","id":1238659,"avatar_url":"https://avatars.githubusercontent.com/u/1238659?v=3","gravatar_id":"","url":"https://api.github.com/users/cjcenizal","html_url":"https://github.com/cjcenizal","followers_url":"https://api.github.com/users/cjcenizal/followers","following_url":"https://api.github.com/users/cjcenizal/following{/other_user}","gists_url":"https://api.github.com/users/cjcenizal/gists{/gist_id}","starred_url":"https://api.github.com/users/cjcenizal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjcenizal/subscriptions","organizations_url":"https://api.github.com/users/cjcenizal/orgs","repos_url":"https://api.github.com/users/cjcenizal/repos","events_url":"https://api.github.com/users/cjcenizal/events{/privacy}","received_events_url":"https://api.github.com/users/cjcenizal/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/kibana/pulls/7435/commits","review_comments_url":"https://api.github.com/repos/elastic/kibana/pulls/7435/comments","review_comment_url":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/kibana/issues/7435/comments","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/b0fca9083dad2ffe10ef0bd774350f905c027ab0","head":{"label":"epixa:styleguide","ref":"styleguide","sha":"b0fca9083dad2ffe10ef0bd774350f905c027ab0","user":{"login":"epixa","id":53814,"avatar_url":"https://avatars.githubusercontent.com/u/53814?v=3","gravatar_id":"","url":"https://api.github.com/users/epixa","html_url":"https://github.com/epixa","followers_url":"https://api.github.com/users/epixa/followers","following_url":"https://api.github.com/users/epixa/following{/other_user}","gists_url":"https://api.github.com/users/epixa/gists{/gist_id}","starred_url":"https://api.github.com/users/epixa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epixa/subscriptions","organizations_url":"https://api.github.com/users/epixa/orgs","repos_url":"https://api.github.com/users/epixa/repos","events_url":"https://api.github.com/users/epixa/events{/privacy}","received_events_url":"https://api.github.com/users/epixa/received_events","type":"User","site_admin":false},"repo":{"id":42147349,"name":"kibana","full_name":"epixa/kibana","owner":{"login":"epixa","id":53814,"avatar_url":"https://avatars.githubusercontent.com/u/53814?v=3","gravatar_id":"","url":"https://api.github.com/users/epixa","html_url":"https://github.com/epixa","followers_url":"https://api.github.com/users/epixa/followers","following_url":"https://api.github.com/users/epixa/following{/other_user}","gists_url":"https://api.github.com/users/epixa/gists{/gist_id}","starred_url":"https://api.github.com/users/epixa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epixa/subscriptions","organizations_url":"https://api.github.com/users/epixa/orgs","repos_url":"https://api.github.com/users/epixa/repos","events_url":"https://api.github.com/users/epixa/events{/privacy}","received_events_url":"https://api.github.com/users/epixa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/epixa/kibana","description":"Kibana","fork":true,"url":"https://api.github.com/repos/epixa/kibana","forks_url":"https://api.github.com/repos/epixa/kibana/forks","keys_url":"https://api.github.com/repos/epixa/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/epixa/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/epixa/kibana/teams","hooks_url":"https://api.github.com/repos/epixa/kibana/hooks","issue_events_url":"https://api.github.com/repos/epixa/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/epixa/kibana/events","assignees_url":"https://api.github.com/repos/epixa/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/epixa/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/epixa/kibana/tags","blobs_url":"https://api.github.com/repos/epixa/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/epixa/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/epixa/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/epixa/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/epixa/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/epixa/kibana/languages","stargazers_url":"https://api.github.com/repos/epixa/kibana/stargazers","contributors_url":"https://api.github.com/repos/epixa/kibana/contributors","subscribers_url":"https://api.github.com/repos/epixa/kibana/subscribers","subscription_url":"https://api.github.com/repos/epixa/kibana/subscription","commits_url":"https://api.github.com/repos/epixa/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/epixa/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/epixa/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/epixa/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/epixa/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/epixa/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/epixa/kibana/merges","archive_url":"https://api.github.com/repos/epixa/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/epixa/kibana/downloads","issues_url":"https://api.github.com/repos/epixa/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/epixa/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/epixa/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/epixa/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/epixa/kibana/labels{/name}","releases_url":"https://api.github.com/repos/epixa/kibana/releases{/id}","deployments_url":"https://api.github.com/repos/epixa/kibana/deployments","created_at":"2015-09-09T00:54:59Z","updated_at":"2016-09-07T17:15:10Z","pushed_at":"2016-09-16T13:41:51Z","git_url":"git://github.com/epixa/kibana.git","ssh_url":"git@github.com:epixa/kibana.git","clone_url":"https://github.com/epixa/kibana.git","svn_url":"https://github.com/epixa/kibana","homepage":"https://www.elastic.co/products/kibana","size":217260,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"84a504ecf0c5dce3cd19554278abef5169dd6333","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":7833168,"name":"kibana","full_name":"elastic/kibana","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/kibana","description":":bar_chart: Kibana analytics and search dashboard for Elasticsearch","fork":false,"url":"https://api.github.com/repos/elastic/kibana","forks_url":"https://api.github.com/repos/elastic/kibana/forks","keys_url":"https://api.github.com/repos/elastic/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/kibana/teams","hooks_url":"https://api.github.com/repos/elastic/kibana/hooks","issue_events_url":"https://api.github.com/repos/elastic/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/kibana/events","assignees_url":"https://api.github.com/repos/elastic/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/kibana/tags","blobs_url":"https://api.github.com/repos/elastic/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/kibana/languages","stargazers_url":"https://api.github.com/repos/elastic/kibana/stargazers","contributors_url":"https://api.github.com/repos/elastic/kibana/contributors","subscribers_url":"https://api.github.com/repos/elastic/kibana/subscribers","subscription_url":"https://api.github.com/repos/elastic/kibana/subscription","commits_url":"https://api.github.com/repos/elastic/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/kibana/merges","archive_url":"https://api.github.com/repos/elastic/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/kibana/downloads","issues_url":"https://api.github.com/repos/elastic/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/kibana/labels{/name}","releases_url":"https://api.github.com/repos/elastic/kibana/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/kibana/deployments","created_at":"2013-01-26T04:00:59Z","updated_at":"2016-09-16T14:45:51Z","pushed_at":"2016-09-16T17:23:54Z","git_url":"git://github.com/elastic/kibana.git","ssh_url":"git@github.com:elastic/kibana.git","clone_url":"https://github.com/elastic/kibana.git","svn_url":"https://github.com/elastic/kibana","homepage":"https://www.elastic.co/products/kibana","size":264322,"stargazers_count":6009,"watchers_count":6009,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2195,"mirror_url":null,"open_issues_count":1170,"forks":2195,"open_issues":1170,"watchers":6009,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/7435"},"html":{"href":"https://github.com/elastic/kibana/pull/7435"},"issue":{"href":"https://api.github.com/repos/elastic/kibana/issues/7435"},"comments":{"href":"https://api.github.com/repos/elastic/kibana/issues/7435/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/kibana/pulls/7435/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/kibana/pulls/7435/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/kibana/statuses/b0fca9083dad2ffe10ef0bd774350f905c027ab0"}}}}
{"actor":{"display_login":"cjcenizal"}}