Skip to content

Support for custom blocks #79

Closed
@wolfgangwalther

Description

@wolfgangwalther

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions