Skip to content

Rule proposal: vue/no-unused-emit-declarations #1901

Closed
@VasylRolique

Description

@VasylRolique

I've already check open propositions and there no such suggestion

What rule do you want to change? -> vue/no-unused-properties

Does this change cause the rule to produce more or fewer warnings? -> more warnings

How will the change be implemented? (New option, new default behavior, etc.)? -> Would be nice to add 'emits' group into this rule.

Please provide some example code that this change will affect:

<!-- ✓ GOOD -->
<template>
  <div></div>
</template>
<script>
  export default {
    emits: ['count'],
    methods: { 
        setCount () {
             this.$emit('count', newCount) 
        }
     }
  }
</script>


<!-- ✗ BAD (`count` property not used) -->
<template>
  <div></div>
</template>
<script>
  export default {
    emits: ['count'],
  }
</script>

What does the rule currently do for this code? -> nothing with emits

What will the rule do after it's changed? -> It will detect unused emits declaration

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions