From febc7271b9f253e0f7bad7b736b98cf2d156c12c Mon Sep 17 00:00:00 2001 From: Yosuke Ota Date: Thu, 28 Feb 2019 17:06:24 +0900 Subject: [PATCH] New: add `vue/keyword-spacing` rule (#795) --- docs/rules/README.md | 1 + docs/rules/keyword-spacing.md | 23 +++++ lib/configs/no-layout-rules.js | 1 + lib/index.js | 1 + lib/rules/keyword-spacing.js | 12 +++ tests/lib/rules/keyword-spacing.js | 160 +++++++++++++++++++++++++++++ 6 files changed, 198 insertions(+) create mode 100644 docs/rules/keyword-spacing.md create mode 100644 lib/rules/keyword-spacing.js create mode 100644 tests/lib/rules/keyword-spacing.js diff --git a/docs/rules/README.md b/docs/rules/README.md index 82baedd01..95fdb7104 100644 --- a/docs/rules/README.md +++ b/docs/rules/README.md @@ -149,6 +149,7 @@ For example: | [vue/dot-location](./dot-location.md) | enforce consistent newlines before and after dots | :wrench: | | [vue/eqeqeq](./eqeqeq.md) | require the use of `===` and `!==` | :wrench: | | [vue/key-spacing](./key-spacing.md) | enforce consistent spacing between keys and values in object literal properties | :wrench: | +| [vue/keyword-spacing](./keyword-spacing.md) | enforce consistent spacing before and after keywords | :wrench: | | [vue/match-component-file-name](./match-component-file-name.md) | require component name property to match its file name | | | [vue/no-boolean-default](./no-boolean-default.md) | disallow boolean defaults | :wrench: | | [vue/no-empty-pattern](./no-empty-pattern.md) | disallow empty destructuring patterns | | diff --git a/docs/rules/keyword-spacing.md b/docs/rules/keyword-spacing.md new file mode 100644 index 000000000..f053a90b3 --- /dev/null +++ b/docs/rules/keyword-spacing.md @@ -0,0 +1,23 @@ +--- +pageClass: rule-details +sidebarDepth: 0 +title: vue/keyword-spacing +description: enforce consistent spacing before and after keywords +--- +# vue/keyword-spacing +> enforce consistent spacing before and after keywords + +- :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 [keyword-spacing] rule but it applies to the expressions in `