Skip to content

vue/dot-notation conflict with noPropertyAccessFromIndexSignature typescript setting #1788

Closed as not planned
@iliubinskii

Description

@iliubinskii

Checklist

  • [+] I have tried restarting my IDE and the issue persists.
  • [+] I have read the FAQ and my problem is not listed.

Tell us about your environment

  • ESLint version: 8.8.0
  • eslint-plugin-vue version: 8.4.0
  • Node version: 14.18
  • Operating System: Win 10

Please show your full configuration:

tsconfig.json:
  "noPropertyAccessFromIndexSignature": true,

eslintrc.js:
  "vue/dot-notation": "warn",

What did you do?

<script lang="ts">
export default defineComponent({
  setup() {
    const item: Record<string, string> = { name: "Value" };
    return { item };
  }
});
</script>

<template>
  <div>{{ item["name"] }}</div>
</template>

What did you expect to happen?

The rule should leave item["name"] as is because it comes from index signature

What actually happened?

Vue ESLint rule transforms it to item.name after which I see typescript error:
image

Repository to reproduce this issue

I have this issue in private repository.
I will create public reproduction repository on demand, if needed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions