Skip to content

Commit 7ef7de8

Browse files
authored
Change category of vue/require-explicit-emits rule to vue3-strongly-recommended. (#1251)
This is also recommended in the official guide. https://v3.vuejs.org/guide/component-custom-events.html#defining-custom-events
1 parent d4cd35e commit 7ef7de8

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

docs/rules/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ Enforce all the rules in this category, as well as all higher priority rules, wi
129129
| [vue/one-component-per-file](./one-component-per-file.md) | enforce that each component should be in its own file | |
130130
| [vue/prop-name-casing](./prop-name-casing.md) | enforce specific casing for the Prop name in Vue components | |
131131
| [vue/require-default-prop](./require-default-prop.md) | require default value for props | |
132+
| [vue/require-explicit-emits](./require-explicit-emits.md) | require `emits` option with name triggered by `$emit()` | |
132133
| [vue/require-prop-types](./require-prop-types.md) | require type definitions in props | |
133134
| [vue/singleline-html-element-content-newline](./singleline-html-element-content-newline.md) | require a line break before and after the contents of a singleline element | :wrench: |
134135
| [vue/v-bind-style](./v-bind-style.md) | enforce `v-bind` directive style | :wrench: |
@@ -306,7 +307,6 @@ For example:
306307
| [vue/no-useless-v-bind](./no-useless-v-bind.md) | disallow unnecessary `v-bind` directives | :wrench: |
307308
| [vue/padding-line-between-blocks](./padding-line-between-blocks.md) | require or disallow padding lines between blocks | :wrench: |
308309
| [vue/require-direct-export](./require-direct-export.md) | require the component to be directly exported | |
309-
| [vue/require-explicit-emits](./require-explicit-emits.md) | require `emits` option with name triggered by `$emit()` | |
310310
| [vue/require-name-property](./require-name-property.md) | require a name property in Vue components | |
311311
| [vue/script-indent](./script-indent.md) | enforce consistent indentation in `<script>` | :wrench: |
312312
| [vue/sort-keys](./sort-keys.md) | enforce sort-keys in a manner that is compatible with order-in-components | |

docs/rules/require-explicit-emits.md

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ description: require `emits` option with name triggered by `$emit()`
77
# vue/require-explicit-emits
88
> require `emits` option with name triggered by `$emit()`
99
10+
- :gear: This rule is included in `"plugin:vue/vue3-strongly-recommended"` and `"plugin:vue/vue3-recommended"`.
11+
1012
## :book: Rule Details
1113

1214
This rule reports event triggers not declared with the `emits` option. (The `emits` option is a new in Vue.js 3.0.0+)

lib/configs/vue3-strongly-recommended.js

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module.exports = {
2323
'vue/one-component-per-file': 'warn',
2424
'vue/prop-name-casing': 'warn',
2525
'vue/require-default-prop': 'warn',
26+
'vue/require-explicit-emits': 'warn',
2627
'vue/require-prop-types': 'warn',
2728
'vue/singleline-html-element-content-newline': 'warn',
2829
'vue/v-bind-style': 'warn',

lib/rules/require-explicit-emits.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ module.exports = {
8585
type: 'suggestion',
8686
docs: {
8787
description: 'require `emits` option with name triggered by `$emit()`',
88-
categories: undefined,
88+
categories: ['vue3-strongly-recommended'],
8989
url: 'https://eslint.vuejs.org/rules/require-explicit-emits.html'
9090
},
9191
fixable: null,

0 commit comments

Comments
 (0)