Skip to content

Rule proposal: require-component-name #265

Closed
@danielbastos11

Description

@danielbastos11

Please describe what the rule should do:

This rule warns you if the component's name property is undefined

What category of rule is this?

[x] 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 will warn about:

// bad
export default {
  render(){
    return <div />
  }
}
// good
export default {
  name: 'div-component',
  render(){
    return <div />
  }
}

Why should this rule be included

Naming components is a good practice. It makes it easier to debug your code with Vue Devtools, and helps you to keep your code organized. So much so that at least 2 rules on the Style Guide address the issue of how to name your components - one of them is a essential rule.

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