Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

[no-unused-vars] False positive for unused vars inside decorator arguments #126

Closed
@ridaamirini

Description

@ridaamirini

From eslint/typescript-eslint-parser#445

What code were you trying to parse?

import { Component, Vue } from 'vue-property-decorator';
import HelloWorld from './components/HelloWorld.vue';

@Component({
  components: {
    HelloWorld
  }
})
export default class App extends Vue {}

What did you expect to happen?

With eslint-plugin-typescript's typescript/no-unused-vars rule enabled, should lint without errors.

What happened?

error: 'HelloWorld' is defined but never used (no-unused-vars)

It looks like the expression in a decorator's argument position is not taken into context when determining unused vars. Also, when using eslint --fix, code inside decorator arguments are sometimes not formatted correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions