From cd4ec29ed33fde4f81184f81eeddbda0b561dcd2 Mon Sep 17 00:00:00 2001 From: Sharmila Date: Wed, 18 Oct 2017 11:42:26 -0700 Subject: [PATCH] [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. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f0607fa1..360d4457 100644 --- a/README.md +++ b/README.md @@ -2000,7 +2000,7 @@ Other Style Guides - [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. - > 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. + > 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. ```javascript // bad