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

Unexpected end of expression on close of JS multi-line comment within template #398

Closed
mhldtna opened this issue Feb 20, 2018 · 2 comments · Fixed by #532
Closed

Unexpected end of expression on close of JS multi-line comment within template #398

mhldtna opened this issue Feb 20, 2018 · 2 comments · Fixed by #532
Assignees

Comments

@mhldtna
Copy link

mhldtna commented Feb 20, 2018

(Sigh, I noticed in the "Preview" view that the code that I copy/pasted into the code sections is all messed up. I have attached screen shots below so you can see what I have.)

Environment:
eslint@4.18.0
eslint-plugin-vue@4.2.2
eslint-config-airbnb-base@12.1.0
eslint-loader@1.9.0
eslint-plugin-import@2.8.0
node v6.11.3
VSCode version 1.20.0

.eslintrc.json:

{
    "root": true,
    "extends": [
         "airbnb-base",
         "plugin:vue/recommended"
    ],
    "rules": {
        "no-undef": 1,
        "no-unused-vars": 1,
        "vue/no-unused-vars": "error",
        "linebreak-style": ["error", "windows"],
        "eol-last": 0,
        "no-underscore-dangle": 0,
        "quotes": 0,
        "no-restricted-syntax": 0,
        "no-multi-spaces": 0,
        "no-trailing-spaces": 0,
        "no-plusplus": 0,
        "prefer-destructuring": 0,
        "padded-blocks": 0
    }
}

I have the following template in a .vue component. Notice the JS-style comment in the middle.

<template>
  <div>
    <b-table 
      small
      striped
      hover
      foot-clone
      :items="solutions" 
      :fields="columns"
      :filter="filter"
      @row-clicked="rowClicked">
      <template
        slot="top-row"
        slot-scope="{columns, fields}">
        {{ /* columns and fields are properties passed in from the table to the template.
            columns is the number of columns.
            fields is an array of column names
        */ }}
        <td
          v-for="(column) of fields"
          :key="column.key">
          <ColumnFilter :column="column" />
        </td>
      </template>
    </b-table>
  </div>
</template>

eslintrc
eslint parsing error
eslintrc
eslint parsing error

I am getting the following error from eslint, referencing the last line of the comment.

Parsing error: Unexpected end of expression. (vue/no-parsing-error) (25,12)

The squiqqly error indicator is under the first "}" character of the closing "}}".

I believe this is not an error.

@mhldtna
Copy link
Author

mhldtna commented Feb 20, 2018

Looks like the .jpgs that I attached got inserted directly into my issue! I've attached them again.

eslintrc
eslint parsing error

@mysticatea
Copy link
Member

Thank you for this report. I confirmed it: https://jsfiddle.net/zuyjom9m/18/ doesn't output error in devtool's console.

This is a bug in vue-eslint-parser.

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

Successfully merging a pull request may close this issue.

2 participants