The Wayback Machine - https://web.archive.org/web/20220323223923/https://github.com/vuejs/eslint-plugin-vue/issues/1816
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
FloEdelmann opened this issue Mar 16, 2022 · 1 comment
Open

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

FloEdelmann opened this issue Mar 16, 2022 · 1 comment

Comments

@FloEdelmann
Copy link
Member

@FloEdelmann FloEdelmann commented Mar 16, 2022

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',
    }
@ota-meshi
Copy link
Member

@ota-meshi ota-meshi commented Mar 16, 2022

I think it's a good idea to add suggestions 👍

not sure if ESLint suggestions can rename files though

As far as I know, we can't rename files with the ESLint API 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants