Skip to content

Parsing error: Computed property names are not allowed in enums. #274

@FloEdelmann

Description

@FloEdelmann

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?

9.34.0

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

What did you do?

see https://github.com/vuejs/eslint-plugin-vue/actions/runs/17426870338/job/49476333521?pr=2920 and https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/fixtures/script-indent/ts-enum-member-01.vue:

Configuration
{"languageOptions": {"parserOptions": {"parser":"@typescript-eslint/parser"}}}
<script lang="ts">
enum Direction {
  // comment
  Up = 1,
  // comment
  Down,
  Left
    = 2,
  [
    Right
  ] =
    3,
}
</script>

What did you expect to happen?

This test case used to pass with https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.41.0, but started to fail when @typescript-eslint/parser was updated to v8.42.0.

What actually happened?

Parsing error: Computed property names are not allowed in enums.

Note that TypeScript itself complains about the same problem: https://typescript-eslint.io/play#ts=5.9.2&fileType=.tsx&code=KYOwrgtgBAIglgJ2AYwC5wPYigbwFBRQD0RUyGEEoqBUAqgA5QC8UAjADS0lkVUg1CMDAHcQXQgBlgAM0EsoAJglQA2rQBKcAOYALeQF0WtAMxcAvniA&eslintrc=N4KABGBEBOCuA2BTAzpAXGYBfEWg&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false

Link to Minimal Reproducible Example

https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/fixtures/script-indent/ts-enum-member-01.vue

Additional comments

No response

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