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

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

Closed
4 tasks done
zWingz opened this issue Sep 4, 2023 · 5 comments · Fixed by #210
Closed
4 tasks done

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

zWingz opened this issue Sep 4, 2023 · 5 comments · Fixed by #210

Comments

@zWingz
Copy link

zWingz commented Sep 4, 2023

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
@zWingz
Copy link
Author

zWingz commented Sep 4, 2023

@k713927
Copy link

k713927 commented Sep 8, 2023

me too ,how to do

@ernestoalejo
Copy link

Downgrading to v9.2.1 removes the bug but misses out on important things like the integration with generic Vue 3.3 components.

npm i -D vue-eslint-parser@v9.2.1

@zWingz
Copy link
Author

zWingz commented Sep 11, 2023

Downgrading to v9.2.1 removes the bug but misses out on important things like the integration with generic Vue 3.3 components.

npm i -D vue-eslint-parser@v9.2.1

still no work

@PaulCEllsworth
Copy link

Downgrading to v9.2.1 removes the bug but misses out on important things like the integration with generic Vue 3.3 components.

npm i -D vue-eslint-parser@v9.2.1

still no work

Same here (Windows 10, pnpm, node@18.15.0, vue@3.3.4)

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

Successfully merging a pull request may close this issue.

4 participants