You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
TSLint version: TSLint for Visual Studio Code 0.5.32
TypeScript version: 1.8.10
Running TSLint via: Visual Studio Code 1.3.1
TypeScript code being linted
classSomeClass{// TSLint will report this variable isn't usedprivateunusedVar1: any;constructor(// TSLint doesn't suggest to remove "private" keyword because of unused variableprivateunusedVar2: any){// doesn't use this.unusedVar2}}
with tslint.json configuration:
(include if relevant)
Actual behavior
TSLint doesn't report unused variable if local type-level variable is declared using accessibility modifier in constructor parameters list.
Expected behavior
When we add private/public/protected to a constructor parameter we also create a type-level variable.
If we used this specific parameter in constructor just like a normal function call parameter (without using this) but don't access it anywhere else using this, TSLint should report unused local variable.
If we used this specific parameter only inside a constructor but access it as local variable (using this) but nowhere else TSLint should suggest to not declare it as local variable but rather use it as normal function parameter (in reality to remove access modifier private/public/protected).
If we didn't use this parameter at all, it should simply report unused parameter (and arguably unused local variable too).
The text was updated successfully, but these errors were encountered:
Bug Report
0.5.32
1.8.10
1.3.1
TypeScript code being linted
with
tslint.json
configuration:(include if relevant)
Actual behavior
TSLint doesn't report unused variable if local type-level variable is declared using accessibility modifier in constructor parameters list.
Expected behavior
When we add private/public/protected to a constructor parameter we also create a type-level variable.
this
) but don't access it anywhere else usingthis
, TSLint should report unused local variable.this
) but nowhere else TSLint should suggest to not declare it as local variable but rather use it as normal function parameter (in reality to remove access modifierprivate
/public
/protected
).The text was updated successfully, but these errors were encountered: