{"action":"created","comment":{"url":"https://api.github.com/repos/ascribe/javascript/pulls/comments/59390901","id":59390901,"diff_hunk":"@@ -4,16 +4,312 @@\n \n ## Table of Contents\n \n-  1. [Basic Rules](#basic-rules) #TBD\n-  1. [Naming](#naming) #TBD\n-  1. [Declaration](#declaration) #TBD\n-  1. [Alignment](#alignment) #TBD\n-  1. [Quotes](#quotes) #TBD\n-  1. [Spacing](#spacing) #TBD\n-  1. [Props](#props) #TBD\n-  1. [Parentheses](#parentheses) #TBD\n-  1. [Tags](#tags) #TBD\n-  1. [Methods](#methods) #TBD\n-  1. [Ordering](#ordering) #TBD\n+  1. [Basic Rules](#basic-rules)\n+  1. [Naming](#naming)\n+  1. [Declaration](#declaration)\n+  1. [Alignment](#alignment)\n+  1. [Quotes](#quotes)\n+  1. [Spacing](#spacing)\n+  1. [Props](#props)\n+  1. [Parentheses](#parentheses)\n+  1. [Tags](#tags)\n+  1. [Methods](#methods)\n+  1. [Ordering](#ordering)\n+\n+## Basic Rules\n+\n+  - Only include one React component per file.\n+  - Always use JSX syntax.\n+  - Do not use `React.createElement` unless you're initializing the app from a file that is not JSX.\n+\n+## Class vs React.createClass\n+\n+  - Use class extends React.Component unless you have a very good reason to use mixins.\n+\n+  ```javascript\n+  // bad\n+  const Listing = React.createClass({\n+    render() {\n+      return <div />;\n+    }\n+  });\n+\n+  // good\n+  class Listing extends React.Component {\n+    render() {\n+      return <div />;\n+    }\n+  }\n+  ```\n+\n+## Naming\n+\n+  - **Extensions**: Use `.jsx` extension for React components.\n+  - **Filename**: Use PascalCase for filenames. E.g., `ReservationCard.jsx`.\n+  - **Reference Naming**: Use PascalCase for React components and camelCase for their instances:\n+    ```javascript\n+    // bad\n+    const reservationCard = require('./ReservationCard');\n+\n+    // good\n+    const ReservationCard = require('./ReservationCard');\n+\n+    // bad\n+    const ReservationItem = <ReservationCard />;\n+\n+    // good\n+    const reservationItem = <ReservationCard />;\n+    ```\n+\n+    **Component Naming**: Use the filename as the component name. For example, `ReservationCard.jsx` should have a reference name of `ReservationCard`. However, for root components of a directory, use `index.jsx` as the filename and use the directory name as the component name:\n+    ```javascript\n+    // bad\n+    const Footer = require('./Footer/Footer.jsx')\n+\n+    // bad\n+    const Footer = require('./Footer/index.jsx')\n+\n+    // good\n+    const Footer = require('./Footer')\n+    ```\n+\n+\n+## Declaration\n+  - Do not use displayName for naming components. Instead, name the component by reference.\n+\n+    ```javascript\n+    // bad\n+    export default React.createClass({\n+      displayName: 'ReservationCard',\n+      // stuff goes here\n+    });\n+\n+    // good\n+    export default class ReservationCard extends React.Component {\n+    }\n+    ```\n+\n+## Alignment\n+  - Follow these alignment styles for JSX syntax\n+\n+    ```javascript\n+    // bad\n+    <Foo superLongParam=\"bar\"\n+         anotherSuperLongParam=\"baz\" />\n+\n+    // good\n+    <Foo\n+      superLongParam=\"bar\"\n+      anotherSuperLongParam=\"baz\"\n+    />","path":"react/README.md","position":112,"original_position":112,"commit_id":"27c9c44f32b59762155adaf8bcf04a131e215938","original_commit_id":"27c9c44f32b59762155adaf8bcf04a131e215938","user":{"login":"TimDaub","id":2758453,"avatar_url":"https://avatars.githubusercontent.com/u/2758453?v=3","gravatar_id":"","url":"https://api.github.com/users/TimDaub","html_url":"https://github.com/TimDaub","followers_url":"https://api.github.com/users/TimDaub/followers","following_url":"https://api.github.com/users/TimDaub/following{/other_user}","gists_url":"https://api.github.com/users/TimDaub/gists{/gist_id}","starred_url":"https://api.github.com/users/TimDaub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimDaub/subscriptions","organizations_url":"https://api.github.com/users/TimDaub/orgs","repos_url":"https://api.github.com/users/TimDaub/repos","events_url":"https://api.github.com/users/TimDaub/events{/privacy}","received_events_url":"https://api.github.com/users/TimDaub/received_events","type":"User","site_admin":false},"body":"Actually, I prefer how they do it. It's visually more readable I believe.","created_at":"2016-04-12T14:57:05Z","updated_at":"2016-04-12T14:57:05Z","html_url":"https://github.com/ascribe/javascript/pull/11#discussion_r59390901","pull_request_url":"https://api.github.com/repos/ascribe/javascript/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/ascribe/javascript/pulls/comments/59390901"},"html":{"href":"https://github.com/ascribe/javascript/pull/11#discussion_r59390901"},"pull_request":{"href":"https://api.github.com/repos/ascribe/javascript/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/ascribe/javascript/pulls/11","id":61250994,"html_url":"https://github.com/ascribe/javascript/pull/11","diff_url":"https://github.com/ascribe/javascript/pull/11.diff","patch_url":"https://github.com/ascribe/javascript/pull/11.patch","issue_url":"https://api.github.com/repos/ascribe/javascript/issues/11","number":11,"state":"open","locked":false,"title":"Readd React Styleguide","user":{"login":"TimDaub","id":2758453,"avatar_url":"https://avatars.githubusercontent.com/u/2758453?v=3","gravatar_id":"","url":"https://api.github.com/users/TimDaub","html_url":"https://github.com/TimDaub","followers_url":"https://api.github.com/users/TimDaub/followers","following_url":"https://api.github.com/users/TimDaub/following{/other_user}","gists_url":"https://api.github.com/users/TimDaub/gists{/gist_id}","starred_url":"https://api.github.com/users/TimDaub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimDaub/subscriptions","organizations_url":"https://api.github.com/users/TimDaub/orgs","repos_url":"https://api.github.com/users/TimDaub/repos","events_url":"https://api.github.com/users/TimDaub/events{/privacy}","received_events_url":"https://api.github.com/users/TimDaub/received_events","type":"User","site_admin":false},"body":"Welcome to part 6.\r\n\r\n**Last date for comments: 14.03.2016.**\r\n\r\nOther parts\r\n\r\n- #1 \r\n- #2\r\n- #3 \r\n- #4 \r\n- #7 \r\n\r\nIf you're wondering what this is all about, read [this](https://github.com/ascribe/javascript#introduction) and [this](https://github.com/ascribe/javascript#approach).\r\n\r\n**Feel free to ask questions, leave notes and propose changes.**\r\n\r\n[To see a pretty view of the diff (takes you to the first readded Chapter of this PR)](https://github.com/ascribe/javascript/pull/11/files?short_path=0872419#diff-0872419342eff55c74ec7349f0c076f9)\r\n[To see the file in the branch (more readable)](https://github.com/ascribe/javascript/blob/review-react-styleguide/react/README.md)","created_at":"2016-03-01T14:39:32Z","updated_at":"2016-04-12T14:57:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"70261e936bcce6c98b9ca037965961be64d7770c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ascribe/javascript/pulls/11/commits","review_comments_url":"https://api.github.com/repos/ascribe/javascript/pulls/11/comments","review_comment_url":"https://api.github.com/repos/ascribe/javascript/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ascribe/javascript/issues/11/comments","statuses_url":"https://api.github.com/repos/ascribe/javascript/statuses/27c9c44f32b59762155adaf8bcf04a131e215938","head":{"label":"ascribe:review-react-styleguide","ref":"review-react-styleguide","sha":"27c9c44f32b59762155adaf8bcf04a131e215938","user":{"login":"ascribe","id":11942883,"avatar_url":"https://avatars.githubusercontent.com/u/11942883?v=3","gravatar_id":"","url":"https://api.github.com/users/ascribe","html_url":"https://github.com/ascribe","followers_url":"https://api.github.com/users/ascribe/followers","following_url":"https://api.github.com/users/ascribe/following{/other_user}","gists_url":"https://api.github.com/users/ascribe/gists{/gist_id}","starred_url":"https://api.github.com/users/ascribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ascribe/subscriptions","organizations_url":"https://api.github.com/users/ascribe/orgs","repos_url":"https://api.github.com/users/ascribe/repos","events_url":"https://api.github.com/users/ascribe/events{/privacy}","received_events_url":"https://api.github.com/users/ascribe/received_events","type":"Organization","site_admin":false},"repo":{"id":44813405,"name":"javascript","full_name":"ascribe/javascript","owner":{"login":"ascribe","id":11942883,"avatar_url":"https://avatars.githubusercontent.com/u/11942883?v=3","gravatar_id":"","url":"https://api.github.com/users/ascribe","html_url":"https://github.com/ascribe","followers_url":"https://api.github.com/users/ascribe/followers","following_url":"https://api.github.com/users/ascribe/following{/other_user}","gists_url":"https://api.github.com/users/ascribe/gists{/gist_id}","starred_url":"https://api.github.com/users/ascribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ascribe/subscriptions","organizations_url":"https://api.github.com/users/ascribe/orgs","repos_url":"https://api.github.com/users/ascribe/repos","events_url":"https://api.github.com/users/ascribe/events{/privacy}","received_events_url":"https://api.github.com/users/ascribe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ascribe/javascript","description":"Ascribe's JavaScript Style Guide","fork":true,"url":"https://api.github.com/repos/ascribe/javascript","forks_url":"https://api.github.com/repos/ascribe/javascript/forks","keys_url":"https://api.github.com/repos/ascribe/javascript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ascribe/javascript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ascribe/javascript/teams","hooks_url":"https://api.github.com/repos/ascribe/javascript/hooks","issue_events_url":"https://api.github.com/repos/ascribe/javascript/issues/events{/number}","events_url":"https://api.github.com/repos/ascribe/javascript/events","assignees_url":"https://api.github.com/repos/ascribe/javascript/assignees{/user}","branches_url":"https://api.github.com/repos/ascribe/javascript/branches{/branch}","tags_url":"https://api.github.com/repos/ascribe/javascript/tags","blobs_url":"https://api.github.com/repos/ascribe/javascript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ascribe/javascript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ascribe/javascript/git/refs{/sha}","trees_url":"https://api.github.com/repos/ascribe/javascript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ascribe/javascript/statuses/{sha}","languages_url":"https://api.github.com/repos/ascribe/javascript/languages","stargazers_url":"https://api.github.com/repos/ascribe/javascript/stargazers","contributors_url":"https://api.github.com/repos/ascribe/javascript/contributors","subscribers_url":"https://api.github.com/repos/ascribe/javascript/subscribers","subscription_url":"https://api.github.com/repos/ascribe/javascript/subscription","commits_url":"https://api.github.com/repos/ascribe/javascript/commits{/sha}","git_commits_url":"https://api.github.com/repos/ascribe/javascript/git/commits{/sha}","comments_url":"https://api.github.com/repos/ascribe/javascript/comments{/number}","issue_comment_url":"https://api.github.com/repos/ascribe/javascript/issues/comments{/number}","contents_url":"https://api.github.com/repos/ascribe/javascript/contents/{+path}","compare_url":"https://api.github.com/repos/ascribe/javascript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ascribe/javascript/merges","archive_url":"https://api.github.com/repos/ascribe/javascript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ascribe/javascript/downloads","issues_url":"https://api.github.com/repos/ascribe/javascript/issues{/number}","pulls_url":"https://api.github.com/repos/ascribe/javascript/pulls{/number}","milestones_url":"https://api.github.com/repos/ascribe/javascript/milestones{/number}","notifications_url":"https://api.github.com/repos/ascribe/javascript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ascribe/javascript/labels{/name}","releases_url":"https://api.github.com/repos/ascribe/javascript/releases{/id}","deployments_url":"https://api.github.com/repos/ascribe/javascript/deployments","created_at":"2015-10-23T13:02:28Z","updated_at":"2016-03-11T08:30:24Z","pushed_at":"2016-03-08T13:44:33Z","git_url":"git://github.com/ascribe/javascript.git","ssh_url":"git@github.com:ascribe/javascript.git","clone_url":"https://github.com/ascribe/javascript.git","svn_url":"https://github.com/ascribe/javascript","homepage":"https://www.ascribe.io","size":801,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"ascribe:master","ref":"master","sha":"d7b693a850cca6e4887aed987da41a665f295e15","user":{"login":"ascribe","id":11942883,"avatar_url":"https://avatars.githubusercontent.com/u/11942883?v=3","gravatar_id":"","url":"https://api.github.com/users/ascribe","html_url":"https://github.com/ascribe","followers_url":"https://api.github.com/users/ascribe/followers","following_url":"https://api.github.com/users/ascribe/following{/other_user}","gists_url":"https://api.github.com/users/ascribe/gists{/gist_id}","starred_url":"https://api.github.com/users/ascribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ascribe/subscriptions","organizations_url":"https://api.github.com/users/ascribe/orgs","repos_url":"https://api.github.com/users/ascribe/repos","events_url":"https://api.github.com/users/ascribe/events{/privacy}","received_events_url":"https://api.github.com/users/ascribe/received_events","type":"Organization","site_admin":false},"repo":{"id":44813405,"name":"javascript","full_name":"ascribe/javascript","owner":{"login":"ascribe","id":11942883,"avatar_url":"https://avatars.githubusercontent.com/u/11942883?v=3","gravatar_id":"","url":"https://api.github.com/users/ascribe","html_url":"https://github.com/ascribe","followers_url":"https://api.github.com/users/ascribe/followers","following_url":"https://api.github.com/users/ascribe/following{/other_user}","gists_url":"https://api.github.com/users/ascribe/gists{/gist_id}","starred_url":"https://api.github.com/users/ascribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ascribe/subscriptions","organizations_url":"https://api.github.com/users/ascribe/orgs","repos_url":"https://api.github.com/users/ascribe/repos","events_url":"https://api.github.com/users/ascribe/events{/privacy}","received_events_url":"https://api.github.com/users/ascribe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ascribe/javascript","description":"Ascribe's JavaScript Style Guide","fork":true,"url":"https://api.github.com/repos/ascribe/javascript","forks_url":"https://api.github.com/repos/ascribe/javascript/forks","keys_url":"https://api.github.com/repos/ascribe/javascript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ascribe/javascript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ascribe/javascript/teams","hooks_url":"https://api.github.com/repos/ascribe/javascript/hooks","issue_events_url":"https://api.github.com/repos/ascribe/javascript/issues/events{/number}","events_url":"https://api.github.com/repos/ascribe/javascript/events","assignees_url":"https://api.github.com/repos/ascribe/javascript/assignees{/user}","branches_url":"https://api.github.com/repos/ascribe/javascript/branches{/branch}","tags_url":"https://api.github.com/repos/ascribe/javascript/tags","blobs_url":"https://api.github.com/repos/ascribe/javascript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ascribe/javascript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ascribe/javascript/git/refs{/sha}","trees_url":"https://api.github.com/repos/ascribe/javascript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ascribe/javascript/statuses/{sha}","languages_url":"https://api.github.com/repos/ascribe/javascript/languages","stargazers_url":"https://api.github.com/repos/ascribe/javascript/stargazers","contributors_url":"https://api.github.com/repos/ascribe/javascript/contributors","subscribers_url":"https://api.github.com/repos/ascribe/javascript/subscribers","subscription_url":"https://api.github.com/repos/ascribe/javascript/subscription","commits_url":"https://api.github.com/repos/ascribe/javascript/commits{/sha}","git_commits_url":"https://api.github.com/repos/ascribe/javascript/git/commits{/sha}","comments_url":"https://api.github.com/repos/ascribe/javascript/comments{/number}","issue_comment_url":"https://api.github.com/repos/ascribe/javascript/issues/comments{/number}","contents_url":"https://api.github.com/repos/ascribe/javascript/contents/{+path}","compare_url":"https://api.github.com/repos/ascribe/javascript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ascribe/javascript/merges","archive_url":"https://api.github.com/repos/ascribe/javascript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ascribe/javascript/downloads","issues_url":"https://api.github.com/repos/ascribe/javascript/issues{/number}","pulls_url":"https://api.github.com/repos/ascribe/javascript/pulls{/number}","milestones_url":"https://api.github.com/repos/ascribe/javascript/milestones{/number}","notifications_url":"https://api.github.com/repos/ascribe/javascript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ascribe/javascript/labels{/name}","releases_url":"https://api.github.com/repos/ascribe/javascript/releases{/id}","deployments_url":"https://api.github.com/repos/ascribe/javascript/deployments","created_at":"2015-10-23T13:02:28Z","updated_at":"2016-03-11T08:30:24Z","pushed_at":"2016-03-08T13:44:33Z","git_url":"git://github.com/ascribe/javascript.git","ssh_url":"git@github.com:ascribe/javascript.git","clone_url":"https://github.com/ascribe/javascript.git","svn_url":"https://github.com/ascribe/javascript","homepage":"https://www.ascribe.io","size":801,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ascribe/javascript/pulls/11"},"html":{"href":"https://github.com/ascribe/javascript/pull/11"},"issue":{"href":"https://api.github.com/repos/ascribe/javascript/issues/11"},"comments":{"href":"https://api.github.com/repos/ascribe/javascript/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/ascribe/javascript/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/ascribe/javascript/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ascribe/javascript/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/ascribe/javascript/statuses/27c9c44f32b59762155adaf8bcf04a131e215938"}}}}