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"
  ],
 ...
}

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