Skip to content

Bug: Parsing error: Cannot set property index of Error which has only a getter #206

Closed
@zWingz

Description

@zWingz

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I'm using eslint-plugin-vue.
  • I'm sure the problem is a parser problem. (If you are not sure, search for the issue in eslint-plugin-vue repo and open the issue in eslint-plugin-vue repo if there is no solution.
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.

What version of ESLint are you using?

latest

What version of eslint-plugin-vue and vue-eslint-parser are you using?

  • vue-eslint-parser@latest
  • eslint-plugin-vue@latest

What did you do?

Configuration

ESLint Config

module.exports = {
  extends: [
    // add more generic rulesets here, such as:
    'eslint:recommended',
  ],
  parser: 'vue-eslint-parser',
  parserOptions: {
    parser: '@typescript-eslint/parser',
    ecmaVersion: 6,
    extraFileExtensions: ['.vue'],
    ecmaFeatures: {
      jsx: true,
    },
    project: true, // will work if disable this line
  },
  plugins: ['@typescript-eslint'],
}

tsconfig

{
  "compilerOptions": {
    "baseUrl": ".",
    "target": "es6",
    "module": "esnext",
    "moduleResolution": "node",
    "strict": true,
    "jsx": "preserve",
    "sourceMap": true,
    "resolveJsonModule": true,
    "esModuleInterop": true,
    "experimentalDecorators": true,
    "skipLibCheck": true,
    "lib": ["esnext", "dom"],
  },
  "include": [
    "."
  ],
  "exclude": ["node_modules"]
}

App

<template>
  <div>1</div>
</template>
<script lang="tsx">
import { defineComponent } from 'vue'
  const test = 1;
    const b = 2;
      const test = defineComponent({
        props: {
          test: String,
        },
        render() {
          return <div>test</div>
        }
      })
</script>

What did you expect to happen?

image

What actually happened?

image

Link to Minimal Reproducible Example

https://github.com/zWingz/test-vue-eslint

Additional comments

enable or disable the project: true

image image

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