Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

no-unused-variable: variable used in decorator function throws error #1421

Closed
dms1lva opened this issue Jul 21, 2016 · 1 comment
Closed

Comments

@dms1lva
Copy link

dms1lva commented Jul 21, 2016

Bug Report

  • TSLint version: 3.13.0
  • TypeScript version: 1.8.10
  • Running TSLint via: CLI

TypeScript code being linted

class NiceClass {
  @myNiceDecorator()
  public methodWithDecorator() {

  }

  private methodUsedInDecorator() {

  }
}

function myNiceDecorator() {
  this.methodUsedInDecorator();
}

with tslint.json configuration:

{
     "rules" :{
         "no-unused-variable": true
     }
}

Actual behavior

This error is thrown:
random.ts[7, 11]: Unused method: 'methodUsedInDecorator'

Expected behavior

No error should be thrown

@andy-hanson
Copy link
Contributor

Should be fixed by #2235.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants