Skip to content

Match component file name #667

Closed
Closed
@rodrigopedra

Description

@rodrigopedra

Please describe what the rule should do:

This rule check if a component's name attribute matches its file name. By default it checks only .jsx files, but an additional option is provided to check both .jsx and .vue files

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:

// src/MyComponent.jsx
export default {
  name: 'MComponent', // this rule would warn of the mismatch between component's name
  render() { return <div /> }
}

Additional context

As discussed with @chrisvfritz in the #589 PR comments

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