From a5fa7ee8efebc5f27c85c0bc9fff0d3584a03688 Mon Sep 17 00:00:00 2001 From: yosuke ota Date: Sat, 6 Jun 2020 21:51:50 +0900 Subject: [PATCH] Add `vue/object-property-newline` rule --- docs/rules/README.md | 1 + docs/rules/object-property-newline.md | 25 ++++++ lib/configs/no-layout-rules.js | 1 + lib/index.js | 1 + lib/rules/object-property-newline.js | 12 +++ tests/lib/rules/object-property-newline.js | 90 ++++++++++++++++++++++ 6 files changed, 130 insertions(+) create mode 100644 docs/rules/object-property-newline.md create mode 100644 lib/rules/object-property-newline.js create mode 100644 tests/lib/rules/object-property-newline.js diff --git a/docs/rules/README.md b/docs/rules/README.md index e44b2855b..3c0c1e125 100644 --- a/docs/rules/README.md +++ b/docs/rules/README.md @@ -329,6 +329,7 @@ The following rules extend the rules provided by ESLint itself and apply them to | [vue/no-restricted-syntax](./no-restricted-syntax.md) | disallow specified syntax | | | [vue/no-useless-concat](./no-useless-concat.md) | disallow unnecessary concatenation of literals or template literals | | | [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/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/object-property-newline.md b/docs/rules/object-property-newline.md new file mode 100644 index 000000000..3095ebfc7 --- /dev/null +++ b/docs/rules/object-property-newline.md @@ -0,0 +1,25 @@ +--- +pageClass: rule-details +sidebarDepth: 0 +title: vue/object-property-newline +description: enforce placing object properties on separate lines +--- +# vue/object-property-newline +> enforce placing object properties on separate lines + +- :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 [object-property-newline] rule but it applies to the expressions in `