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

Support for custom blocks #79

Closed
wolfgangwalther opened this issue Aug 12, 2020 · 0 comments · Fixed by #90
Closed

Support for custom blocks #79

wolfgangwalther opened this issue Aug 12, 2020 · 0 comments · Fixed by #90

Comments

@wolfgangwalther
Copy link

eslint-plugin-vue-i18n uses vue-eslint-parser to load .vue files and do some linting of <i18n> custom blocks.

This breaks down with something like the following (see intlify/eslint-plugin-vue-i18n#107):

<i18n lang="yaml" locale="en">
unused: "<i"
</i18n>

This works with vue-loader, because the content of the custom block is not parsed as HTML.

If I understand correctly, the problem is that vue-eslint-parser tries to parse the whole document as HTML. The <i is invalid HTML and breaks this parsing. I guess the <script> tag is handled specially already. It would be good if vue-eslint-parser would handle custom blocks by returning the raw content instead of trying to parse them as HTML. The content of a top-level block should only be parsed as HTML if it's either a <template> block without lang attribute or if the lang attribute is set to lang="html".

This should also solve #63 maybe?

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

Successfully merging a pull request may close this issue.

1 participant