Skip to content

Drop support for vue files to avoid conflicts with eslint-plugin-vue #103

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

Closed
BPScott opened this issue Sep 27, 2018 · 2 comments
Closed

Comments

@BPScott
Copy link

BPScott commented Sep 27, 2018

eslint-plugin-html and eslint-plugin-vue conflict with each other as per https://github.com/vuejs/eslint-plugin-vue/blob/562fde184a7a37f551fc98711a0bb4233c749606/README.md#why-doesnt-it-work-on-vue-file

This is because the processor in eslint-plugin-vue does not modify the vue file when processing the file, while eslint-plugin-vue's processor extracts just the <script> element.

This then has a knock-on effect in eslint-plugin-prettier because it doesn't know what parser it should use (if someone is using eslint-plugin-vue then it is acting upon a full vue file so it should use the vue parser, if someone is using eslint-plugin-html it is acting upon a JS fragment so it should use the babylon parser).


I feel the easiest approach for interoperability is to remove support for .vue files and to direct people to use eslint-plugin-vue if they want to lint their vue files. This has the side effect of offering fuller linting for the vue file as it supports linting the <template> and <style> tags in addition to the <script> tag

@BenoitZugmeyer
Copy link
Owner

This is a known issue, and both plugin document it in its README (see). The only thing I can do to go further is to remove the .vue from the default extensions.

@BPScott
Copy link
Author

BPScott commented Sep 27, 2018

Thanks for that context, I missed that section in your readme.

The only thing I can do to go further is to remove the .vue from the default extensions.

I think that would be best. Doing so in v5 as a breaking change makes most sense to me and it sounds like you're already planning a v5 release anyway. As it currently stands it is not possible for somebody to use eslint-plugin-vue >=3.0.0 and eslint-plugin-html at the same time without losing the linting of the <template> and <style> sections.

Removing .vue from the default extensions would allow you to update the README to say something like:

eslint-plugin-vue v3.0.0 and later versions are incompatible with eslint-plugin-html versions earlier than v5.0.0. To ensure eslint-plugin-vue functionality is not affected you must use eslint-plugin-html v5.0.0 or later.

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

No branches or pull requests

2 participants