diff --git a/docs/rules/README.md b/docs/rules/README.md index f0bd7578e..f704c1a61 100644 --- a/docs/rules/README.md +++ b/docs/rules/README.md @@ -264,7 +264,7 @@ For example: | [vue/sort-keys](./sort-keys.md) | enforce sort-keys in a manner that is compatible with order-in-components | | :hammer: | | [vue/static-class-names-order](./static-class-names-order.md) | enforce static class names order | :wrench: | :hammer: | | [vue/v-for-delimiter-style](./v-for-delimiter-style.md) | enforce `v-for` directive's delimiter style | :wrench: | :lipstick: | -| [vue/v-on-function-call](./v-on-function-call.md) | enforce or forbid parentheses after method calls without arguments in `v-on` directives | :wrench: | :hammer: | +| [vue/v-on-handler-style](./v-on-handler-style.md) | enforce writing style for handlers in `v-on` directives | :wrench: | :hammer: | @@ -324,6 +324,7 @@ The following rules extend the rules provided by ESLint itself and apply them to |:--------|:------------| | [vue/no-invalid-model-keys](./no-invalid-model-keys.md) | [vue/valid-model-definition](./valid-model-definition.md) | | [vue/script-setup-uses-vars](./script-setup-uses-vars.md) | (no replacement) | +| [vue/v-on-function-call](./v-on-function-call.md) | [vue/v-on-handler-style](./v-on-handler-style.md) | ## Removed diff --git a/docs/rules/v-on-event-hyphenation.md b/docs/rules/v-on-event-hyphenation.md index 6a21408c5..9fdd80829 100644 --- a/docs/rules/v-on-event-hyphenation.md +++ b/docs/rules/v-on-event-hyphenation.md @@ -107,6 +107,7 @@ Don't use hyphenated name but allow custom event names - [vue/custom-event-name-casing](./custom-event-name-casing.md) - [vue/attribute-hyphenation](./attribute-hyphenation.md) +- [vue/v-on-handler-style](./v-on-handler-style.md) ## :books: Further Reading diff --git a/docs/rules/v-on-function-call.md b/docs/rules/v-on-function-call.md index edd48f084..c80dafc60 100644 --- a/docs/rules/v-on-function-call.md +++ b/docs/rules/v-on-function-call.md @@ -9,6 +9,7 @@ since: v5.2.0 > enforce or forbid parentheses after method calls without arguments in `v-on` directives +- :warning: This rule was **deprecated** and replaced by [vue/v-on-handler-style](v-on-handler-style.md) rule. - :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. ## :book: Rule Details diff --git a/docs/rules/v-on-handler-style.md b/docs/rules/v-on-handler-style.md new file mode 100644 index 000000000..18494e105 --- /dev/null +++ b/docs/rules/v-on-handler-style.md @@ -0,0 +1,219 @@ +--- +pageClass: rule-details +sidebarDepth: 0 +title: vue/v-on-handler-style +description: enforce writing style for handlers in `v-on` directives +--- +# vue/v-on-handler-style + +> enforce writing style for handlers in `v-on` directives + +- :exclamation: ***This rule has not been released yet.*** +- :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. + +## :book: Rule Details + +This rule aims to enforce a consistent style in `v-on` event handlers: + +```vue + +