Skip to content
This repository has been archived by the owner on Apr 21, 2019. It is now read-only.

Style guide #70

Merged
merged 3 commits into from
Aug 15, 2016
Merged

Style guide #70

merged 3 commits into from
Aug 15, 2016

Conversation

ivanbatic
Copy link
Contributor

@ivanbatic ivanbatic commented Aug 2, 2016

Added the first style guide doc draft.


This change is Reviewable

2. Avoid passing function references as arguments.
3. Only surround arrow function parameters when
For example, `(x) => x + x` is wrong but the following are correct:
- `x => x + x`
Copy link
Contributor

Choose a reason for hiding this comment

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

What if you want to give the parameter a type? x: number => x+ x will not work, you need to say (x: number) => x + x

Copy link
Contributor Author

@ivanbatic ivanbatic Aug 3, 2016

Choose a reason for hiding this comment

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

Yes, read the lines below :)
The point is to use the simplest expression needed.
If there's a single argument for which the type is inferred, no need for parentheses, an so on.

Copy link
Contributor

Choose a reason for hiding this comment

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

Incomplete sentence: Only surround arrow function parameters when... when what? :)

@mayacoda mayacoda merged commit fca1243 into rabix:next Aug 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants