Skip to content

vue/html-quotes conflicting with template strings in pug #18

@la-magra

Description

@la-magra

Unsure if this conflict should be reported here or in https://github.com/vuejs/eslint-plugin-vue .

Given a valid pug template that uses template strings (https://pugjs.org/language/attributes.html#multiline-attributes):

<template lang="pug">
a(
  :href=`
    thing
    + more
    + '&more='
    + very_long
  `
)
  | thing
</template>

and a basic eslint config with the following plugins:

plugin:vue/recommended
@vue/standard
plugin:vue-pug/recommended // we are on vue2

We get: vue/html-quotes: Expected to be enclosed by double quotes.

And upon running with --fix, the file gets mauled savagely:

<template lang="pug">
a(
  :href=`"
    thing
    + more
    + '&other='
    + other
  `"
)
  | thing
</template>

So far we have been running with //- eslint-disable vue/html-quotes and //- eslint-enable ... over the concerned blocks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions