From 9122b405f79c640f5cc30746993de76bfef4a637 Mon Sep 17 00:00:00 2001 From: Yosuke Ota Date: Sat, 23 May 2020 11:15:44 +0900 Subject: [PATCH 1/3] Add `vue/no-extra-parens` rule --- docs/rules/README.md | 2 + docs/rules/no-extra-parens.md | 45 +++++++ lib/configs/no-layout-rules.js | 1 + lib/index.js | 2 + lib/rules/no-extra-parens.js | 177 +++++++++++++++++++++++++++ lib/utils/index.js | 55 ++++++--- tests/lib/rules/no-extra-parens.js | 188 +++++++++++++++++++++++++++++ 7 files changed, 451 insertions(+), 19 deletions(-) create mode 100644 docs/rules/no-extra-parens.md create mode 100644 lib/rules/no-extra-parens.js create mode 100644 tests/lib/rules/no-extra-parens.js diff --git a/docs/rules/README.md b/docs/rules/README.md index 8916464e6..2d40a8a3e 100644 --- a/docs/rules/README.md +++ b/docs/rules/README.md @@ -291,6 +291,7 @@ For example: | [vue/no-boolean-default](./no-boolean-default.md) | disallow boolean defaults | :wrench: | | [vue/no-duplicate-attr-inheritance](./no-duplicate-attr-inheritance.md) | enforce `inheritAttrs` to be set to `false` when using `v-bind="$attrs"` | | | [vue/no-empty-pattern](./no-empty-pattern.md) | disallow empty destructuring patterns | | +| [vue/no-extra-parens](./no-extra-parens.md) | disallow unnecessary parentheses | :wrench: | | [vue/no-irregular-whitespace](./no-irregular-whitespace.md) | disallow irregular whitespace | | | [vue/no-potential-component-option-typo](./no-potential-component-option-typo.md) | disallow a potential typo in your component property | | | [vue/no-reserved-component-names](./no-reserved-component-names.md) | disallow the use of reserved names in component definitions | | @@ -308,6 +309,7 @@ For example: | [vue/require-name-property](./require-name-property.md) | require a name property in Vue components | | | [vue/script-indent](./script-indent.md) | enforce consistent indentation in `