Commit 49b672bb authored by Mark Florian's avatar Mark Florian

Remove docs discouraging single-line conditionals

Our linting rules currently allow braceless conditionals, and we have
hundreds of instances of it in the codebase. It's fairly clear that this
is acceptable in general to our engineers, so we shouldn't discourage it
in our docs.
parent 4044ef15
...@@ -189,24 +189,6 @@ are loaded dynamically with webpack. ...@@ -189,24 +189,6 @@ are loaded dynamically with webpack.
Do not use `innerHTML`, `append()` or `html()` to set content. It opens up too many Do not use `innerHTML`, `append()` or `html()` to set content. It opens up too many
vulnerabilities. vulnerabilities.
## Avoid single-line conditional statements
Indentation is important when scanning code as it gives a quick indication of the existence of branches, loops, and return points.
This can help to quickly understand the control flow.
```javascript
// bad
if (isThingNull) return '';
if (isThingNull)
return '';
// good
if (isThingNull) {
return '';
}
```
## ESLint ## ESLint
ESLint behavior can be found in our [tooling guide](../tooling.md). ESLint behavior can be found in our [tooling guide](../tooling.md).
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment