Skip to content

Rule proposal: no method as component option #922

Closed
@TheAlexLichter

Description

@TheAlexLichter

Please describe what the rule should do:
To avoid typos for the methods declaration, like

export default {
  method: {
    myMethod(){ /*...*/ }
  }
}

I suggest to add a rule which prohibits method as a key in the default component export ☺️

What category should the rule belong to?

  • Enforces code style
  • Warns about a potential error
  • Suggests an alternate way of doing something
  • Other (please specify:)

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

export default {
  name: 'app',
  props: {
    propA: Number
  },
  method: {
    myMethod() { return true }
  }
}

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