Skip to content

Commit cd4ec29

Browse files
[eslint config] [base] Enables eslint rule for operator-linebreak
Requiring operators at the beginning of the line makes code more readable. When operators are on the left hand side they mirror the syntax of method chaining and it is easy to see the build of logic in a statement. This also updates the readme and fixes a style violation as a result of adding this rule in eslint-config-airbnb/test/test-base.js and eslint-config-airbnb-base/test/test-base.js.
1 parent f2a65c6 commit cd4ec29

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2000,7 +2000,7 @@ Other Style Guides
20002000
<a name="control-statements"></a>
20012001
- [17.1](#control-statements) In case your control statement (`if`, `while` etc.) gets too long or exceeds the maximum line length, each (grouped) condition could be put into a new line. The logical operator should begin the line.
20022002
2003-
> Why? Having operators at the beginning of the line keeps the operators aligned and follows a pattern similar to method chaining. This also improves readability by making it easier to visually follow complex logic.
2003+
> Why? Requiring operators at the beginning of the line keeps the operators aligned and follows a pattern similar to method chaining. This also improves readability by making it easier to visually follow complex logic.
20042004
20052005
```javascript
20062006
// bad

0 commit comments

Comments
 (0)