vuejs / vue-eslint-parser

The ESLint custom parser for `.vue` files.
MIT License
443 stars 74 forks source link

when i use `[x: string]: any;` in a component class, i got a `'x' is not defind` #162

Closed ChangJin0520 closed 2 years ago

ChangJin0520 commented 2 years ago

Hi, when i use [x: string]: any; in a component class, i got an 'x' is not defind.. but in a ts file, it is work well.

env

node v14.18.0

vue v2.6.14 vue-property-decorator v9.1.2

TypeScript v4.7.3 ESLint v7.32.0 vue-eslint-parser v7.11.0

code

<script lang="ts">
import { Vue } from 'vue-property-decorator';

export default class TestComponent extends Vue {
    [x: string]: any;
}
</script>
import { Vue } from 'vue-property-decorator';

export class SignUkey extends Vue {
    [x: string]: any;
}

vue

image

ts

image
ota-meshi commented 2 years ago

Please provide a minimal repository to reproduce the problem.