Skip to content

Rule Proposal: Validate "emits" section #1787

Open
@iliubinskii

Description

@iliubinskii

Please describe what the rule should do:

This rule proposal is based on this issue:
vuejs/core#5343

It should ensure that emits section does not break vue component typing.

What category should the rule belong to?

Warns about a potential error (problem)

Provide 2-3 code examples that this rule should warn about:

Valid:

export default defineComponent({
  name: "Sample",
  emits: {
    event1(this: undefined): boolean { return true; },
    event2: (): boolean => { return true; },
    event3: function(this: undefined): boolean { … }
  },

Invalid:

export default defineComponent({
  name: "Sample",
  emits: {
    event(): boolean { return true; },
    event: function(): boolean { … }
  },

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