Skip to content

Add suggestion(s) to vue/match-component-file-name #1816

Closed
@FloEdelmann

Description

@FloEdelmann

What rule do you want to change?
vue/match-component-file-name

Does this change cause the rule to produce more or fewer warnings?
Same.

How will the change be implemented? (New option, new default behavior, etc.)?
New suggestions that can be applied by the user via the editor:

  • "Rename component to match file name." (without file extension)
  • "Rename file to match component name." (not sure if ESLint suggestions can rename files though)

Note that we can't add an auto-fix here because the user intent is not clear.

Please provide some example code that this change will affect:

// file name: "MySuperCoolComponent.vue"
export default {
  name: 'MyAwesomeComponent',
}

What does the rule currently do for this code?
Report, but no auto-fix and no suggestions.

What will the rule do after it's changed?
Report, still no auto-fix, but suggestions.

  • Rename component to match file name.
    // file name: "MySuperCoolComponent.vue"
    export default {
      name: 'MySuperCoolComponent',
    }
  • Rename file to match component name.
    // file name: "MyAwesomeComponent.vue"
    export default {
      name: 'MyAwesomeComponent',
    }

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