Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #273; update codestyle doc #274

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Contributing

**We're really happy you're interested in contributing to Decent!** :heart:

If you have any problems whilst trying to contribute, feel free to ask us on [meta.decent.chat](https://meta.decent.chat/servers/meta.decent.chat/).

Please attempt to follow the codestyle for JS/CSS below. If we find any issues with codestyle in pull-requests then we'll just flag them up and ask you to fix them.

## JavaScript Codestyle

* Two spaces for indentation
Expand Down Expand Up @@ -34,6 +40,16 @@
}
```

* Use single quotes in HTML/JSX

```js
function msgTextToEl(text) {
return <div class='Message-content'>
{text}
</div>
Copy link
Collaborator Author

@bates64 bates64 Mar 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSX here because then I don't want to have to explain the use of choo/html. Also, we're probably going to switch to Preact sometime soon.

}
```

* Prefer `const` over `let` over `var`

```diff
Expand Down Expand Up @@ -65,7 +81,7 @@
+ const { a, b, c } = obj
```

* Use trailing commas in multiline literals
* Prefer trailing commas in multiline literals

```diff
const arr = [
Expand Down