From 6e1f11185d95432ba90a647efc027bd32983f17d 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. --- packages/eslint-config-airbnb-base/rules/style.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/eslint-config-airbnb-base/rules/style.js b/packages/eslint-config-airbnb-base/rules/style.js index 88f4210d..3195e875 100644 --- a/packages/eslint-config-airbnb-base/rules/style.js +++ b/packages/eslint-config-airbnb-base/rules/style.js @@ -374,8 +374,9 @@ module.exports = { // http://eslint.org/docs/rules/operator-assignment 'operator-assignment': ['error', 'always'], - // enforce operators to be placed before or after line breaks - 'operator-linebreak': 'off', + // Requires operator at the beginning of the line in multiline statements + // https://eslint.org/docs/rules/operator-linebreak + 'operator-linebreak': ['error', 'before'], // disallow padding within blocks 'padded-blocks': ['error', { blocks: 'never', classes: 'never', switches: 'never' }],