From 3812d412ebe6b1dc7ce9f4e25f500002ddc28a84 Mon Sep 17 00:00:00 2001 From: Yosuke Ota Date: Sun, 7 Jun 2020 19:25:57 +0900 Subject: [PATCH] Add `vue/operator-linebreak` rule (#1200) * Add `vue/operator-linebreak` rule * fix --- docs/rules/README.md | 1 + docs/rules/operator-linebreak.md | 25 +++++ lib/configs/no-layout-rules.js | 1 + lib/index.js | 1 + lib/rules/operator-linebreak.js | 9 ++ tests/lib/rules/operator-linebreak.js | 129 ++++++++++++++++++++++++++ 6 files changed, 166 insertions(+) create mode 100644 docs/rules/operator-linebreak.md create mode 100644 lib/rules/operator-linebreak.js create mode 100644 tests/lib/rules/operator-linebreak.js diff --git a/docs/rules/README.md b/docs/rules/README.md index 636d67686..261eed05c 100644 --- a/docs/rules/README.md +++ b/docs/rules/README.md @@ -333,6 +333,7 @@ The following rules extend the rules provided by ESLint itself and apply them to | [vue/object-curly-newline](./object-curly-newline.md) | enforce consistent line breaks inside braces | :wrench: | | [vue/object-curly-spacing](./object-curly-spacing.md) | enforce consistent spacing inside braces | :wrench: | | [vue/object-property-newline](./object-property-newline.md) | enforce placing object properties on separate lines | :wrench: | +| [vue/operator-linebreak](./operator-linebreak.md) | enforce consistent linebreak style for operators | :wrench: | | [vue/prefer-template](./prefer-template.md) | require template literals instead of string concatenation | :wrench: | | [vue/space-in-parens](./space-in-parens.md) | enforce consistent spacing inside parentheses | :wrench: | | [vue/space-infix-ops](./space-infix-ops.md) | require spacing around infix operators | :wrench: | diff --git a/docs/rules/operator-linebreak.md b/docs/rules/operator-linebreak.md new file mode 100644 index 000000000..080e7e777 --- /dev/null +++ b/docs/rules/operator-linebreak.md @@ -0,0 +1,25 @@ +--- +pageClass: rule-details +sidebarDepth: 0 +title: vue/operator-linebreak +description: enforce consistent linebreak style for operators +--- +# vue/operator-linebreak +> enforce consistent linebreak style for operators + +- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. + +This rule is the same rule as core [operator-linebreak] rule but it applies to the expressions in `