felixge / felixge/node-style-guide

else/else if on newline

Open
#91 6 comments 6 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5k
Forks
893
PR merge metrics
No merged PRs in 30d

Description

I prefer to move logic constructions in separated lines:

```javascript
if (a) {
// ...
}
else if (a != b) {
// ...
}
else {
// ...
}
```

This makes code more git friendly (like trailing commas). And also it makes it simple to comment `else if` and `else` sections. Each block is prepended with it's own condition.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.