Skip to content

[@typescript-eslint/no-unnecessary-type-assertion] Puzzling fix in vue ts project #2591

Closed
@eightHundreds

Description

@eightHundreds
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

https://github.com/eightHundreds/eslint-vue-ts--typescript-eslint-no-unnecessary-type-assertion-issue

  1. git clone
  2. npm i
  3. npx eslint ./src/components/tmp.vue --fix

Expected Result

<script lang="ts">
/* eslint-disable class-methods-use-this */
export default class Cmp {
  get a() {
    const list: Array<string> = [];
    return list;
  }

  async mounted() {
    this.a as Array<string>;
  }
}
</script>

Actual Result

<script lang="ts">
/* eslint-disable class-methods-use-this */
export default class Cmp {
  get a() {
    const list: Array<string> = [];
    return list;
  }

  async mouna as Array<string>;
  }
}
</script>

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 4.2.0
@typescript-eslint/parser 4.2.0
TypeScript 3.9.3
ESLint 7.9.0
node 10.14.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomerspackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions