Skip to content

v-for with (item, index) parsing errors #98

Closed
@gcandal

Description

@gcandal

First of all, I'm sorry if the issue doesn't have the best format but I couldn't guidelines for opening issues.

Description

We've encountered several false-positives when running ESLint:

error  Parsing error: ...  Unexpected token
...
> 1 | for(let [(item,]index) in items);
    |          ^  vue/no-parsing-error

This happens with every instance of v-for="(item, index) in items".

Versions

  • Node: v12.19.0
  • eslint-plugin-vue: 7.4.0
  • ESLint: 7.16.0

ESLint config (partial)

{
  "env": {
    "browser": true,
    "es6": true,
    "jasmine": true,
    "es2021": true,
    "node": true
  },
  "globals": {
    "document": "readonly",
    "navigator": "readonly",
    "window": "readonly"
  },
  "parser": ".../node_modules/vue-eslint-parser/index.js",
  "parserOptions": {
    "parser": "@babel/eslint-parser",
    "ecmaVersion": 2020,
    "sourceType": "module",
    "requireConfigFile": false,
    "ecmaFeatures": {
      "jsx": true
    }
  },
  "plugins": [
    "promise",
    "node",
    "import",
    "mocha",
    "vue"
  ],
 ...
}

Activity

changed the title [-]v-for parsing errors starting from [/-] [+]v-for with (item, index) parsing errors[/+] on Jan 21, 2021
joamag

joamag commented on Jan 21, 2021

@joamag

I believe this PR fixes it #97

gcandal

gcandal commented on Jan 21, 2021

@gcandal
Author

@ota-meshi thank you for reacting so quickly, closing this.

ota-meshi

ota-meshi commented on Jan 21, 2021

@ota-meshi
Member

I fixed the bug and published it now.
The version is 7.4.1. It works fine in my environment.

gcandal

gcandal commented on Jan 21, 2021

@gcandal
Author

On mine as well 👍

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

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

        Participants

        @joamag@gcandal@ota-meshi

        Issue actions

          v-for with (item, index) parsing errors · Issue #98 · vuejs/vue-eslint-parser