File tree 6 files changed +1088
-0
lines changed
6 files changed +1088
-0
lines changed Original file line number Diff line number Diff line change @@ -251,6 +251,7 @@ For example:
251
251
| [ vue/no-undef-components] ( ./no-undef-components.md ) | disallow use of undefined components in ` <template> ` | | :hammer : |
252
252
| [ vue/no-undef-properties] ( ./no-undef-properties.md ) | disallow undefined properties | | :hammer : |
253
253
| [ vue/no-unsupported-features] ( ./no-unsupported-features.md ) | disallow unsupported Vue.js syntax on the specified version | :wrench : | :hammer : |
254
+ | [ vue/no-unused-emit-declarations] ( ./no-unused-emit-declarations.md ) | disallow unused emit declarations | | :hammer : |
254
255
| [ vue/no-unused-properties] ( ./no-unused-properties.md ) | disallow unused properties | | :hammer : |
255
256
| [ vue/no-unused-refs] ( ./no-unused-refs.md ) | disallow unused refs | | :hammer : |
256
257
| [ vue/no-use-v-else-with-v-for] ( ./no-use-v-else-with-v-for.md ) | disallow using ` v-else-if ` /` v-else ` on the same element as ` v-for ` | | :hammer : |
Original file line number Diff line number Diff line change
1
+ ---
2
+ pageClass : rule-details
3
+ sidebarDepth : 0
4
+ title : vue/no-unused-emit-declarations
5
+ description : disallow unused emit declarations
6
+ ---
7
+ # vue/no-unused-emit-declarations
8
+
9
+ > disallow unused emit declarations
10
+
11
+ - :exclamation : <badge text =" This rule has not been released yet. " vertical =" middle " type =" error " > *** This rule has not been released yet.*** </badge >
12
+
13
+ ## :book : Rule Details
14
+
15
+ This rule is aimed at eliminating unused emit declarations.
16
+
17
+ <eslint-code-block :rules =" {'vue/no-unused-emit-declarations': ['error']} " >
18
+
19
+ ``` vue
20
+ <!-- ✗ BAD -->
21
+ <script>
22
+ export default {
23
+ emits: ['foo'],
24
+ }
25
+ </script>
26
+ ```
27
+
28
+ </eslint-code-block >
29
+
30
+ <eslint-code-block :rules =" {'vue/no-unused-emit-declarations': ['error']} " >
31
+
32
+ ``` vue
33
+ <!-- ✓ GOOD -->
34
+ <script>
35
+ export default {
36
+ emits: ['foo'],
37
+ methods: {
38
+ foo() {
39
+ this.$emit('foo')
40
+ },
41
+ },
42
+ }
43
+ </script>
44
+ ```
45
+
46
+ </eslint-code-block >
47
+
48
+ ## :wrench : Options
49
+
50
+ Nothing.
51
+
52
+ ## :couple : Related Rules
53
+
54
+ - [ vue/require-explicit-emits] ( ./require-explicit-emits.md )
55
+
56
+ ## :mag : Implementation
57
+
58
+ - [ Rule source] ( https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/no-unused-emit-declarations.js )
59
+ - [ Test source] ( https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/no-unused-emit-declarations.js )
Original file line number Diff line number Diff line change @@ -109,6 +109,10 @@ export default {
109
109
110
110
</eslint-code-block >
111
111
112
+ ## :couple : Related Rules
113
+
114
+ - [ vue/no-unused-emit-declarations] ( ./no-unused-emit-declarations.md )
115
+
112
116
## :books : Further Reading
113
117
114
118
- [ Guide - Custom Events / Defining Custom Events] ( https://v3.vuejs.org/guide/component-custom-events.html#defining-custom-events )
Original file line number Diff line number Diff line change @@ -147,6 +147,7 @@ module.exports = {
147
147
'no-undef-properties' : require ( './rules/no-undef-properties' ) ,
148
148
'no-unsupported-features' : require ( './rules/no-unsupported-features' ) ,
149
149
'no-unused-components' : require ( './rules/no-unused-components' ) ,
150
+ 'no-unused-emit-declarations' : require ( './rules/no-unused-emit-declarations' ) ,
150
151
'no-unused-properties' : require ( './rules/no-unused-properties' ) ,
151
152
'no-unused-refs' : require ( './rules/no-unused-refs' ) ,
152
153
'no-unused-vars' : require ( './rules/no-unused-vars' ) ,
You can’t perform that action at this time.
0 commit comments