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

Vue SFC: HTML folding broken - Wrong lint warning #2242

Closed
3 tasks done
antoinematyja opened this issue Sep 4, 2020 · 2 comments
Closed
3 tasks done

Vue SFC: HTML folding broken - Wrong lint warning #2242

antoinematyja opened this issue Sep 4, 2020 · 2 comments

Comments

@antoinematyja
Copy link

antoinematyja commented Sep 4, 2020

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform: macOS
  • Vetur version: 0.27.1
  • VS Code version: 1.48.2

Problem

When I launched VSCode this morning I wasn't able to fold the HTML in my .vue SFC file. Also weird lint warnings appeared.
I quickly identified this was coming from Vetur. I tried to downgrade to 0.26 and it works fine.

image

As you can see I can fold <template> but nothing inside. Also there is a lint warning which should not happen:

[vue/no-multiple-template-root]
The template root requires exactly one element.

Reproducible Case

The issue happens with any vue SFC file, for instance:

<template>
  <p>
    <div>{{ greeting }} World!</div>
  </p>
</template>

<script>
module.exports = {
  data: function() {
    return {
      greeting: "Hello"
    }
  }
}
</script>

<style scoped>
p {
  font-size: 2em;
  text-align: center;
}
</style>

Thanks!

Edit: here is my .eslintrc.js if this helps:

module.exports = {
  env: {
    browser: true,
    es2020: true
  },
  extends: [
    'plugin:vue/essential',
    'standard'
  ],
  parserOptions: {
    ecmaVersion: 11,
    sourceType: 'module'
  },
  plugins: [
    'vue'
  ],
  rules: {
    'space-before-function-paren': [
      'error',
      {
        anonymous: 'never',
        named: 'never'
      }
    ]
  }
}
@yoyo930021
Copy link
Member

yoyo930021 commented Sep 4, 2020

The HTML folding is same to #2234

@antoinematyja
Copy link
Author

My bad, I searched for "fold" in opened issues and this did not showed.

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

No branches or pull requests

2 participants