Skip to content

Looking at the other issues, I still can't solve the parsing error of adjacent JSX elements must be wrapped in an enclosing tag #882

@ZhenZY

Description

@ZhenZY

Hi I am using vscode and it throws Parsing Error inside template tag in vue files. I am not sure whats causing it. Maybe someone can help.

Thanks in advance.

My environment

  • ESLint Version: 4.15.0
  • eslint-plugin-vue Version: 4.0.0
  • Node Version: 8.9.4

My full configuration

module.exports = {
  root: true,
  parserOptions: {
    parser: 'babel-eslint'
  },
  env: {
    browser: true,
  },
  extends: 'elemefe',
  // required to lint *.vue files
  plugins: [
    'vue'
  ],
  // add your custom rules here
  rules: {
    // allow async-await
    'generator-star-spacing': 'off',
    // allow debugger during development
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
  }
}

The actual source code causing the issue

<template>
  <div id="app">
    <img src="./assets/logo.png"/>
    <router-view/>
  </div>
</template>
<script>
export default {
  name: 'App'
}
</script>

Expect to happen

No parse erorrs displayed

Actually happened
Parsing error: Adjacent JSX elements must be wrapped in an enclosing tag

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