This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 889
no-unused-variable error with object destructuring #2876
Labels
Milestone
Comments
@victornoel Maybe. That issue doesn't seem to include enough information for the reported problem to be reproduced, so who knows? |
@adidahiya any plan to fix this issue? it is really problematic… |
Is this still an issue with TSLint 5.5.0? |
@adidahiya I've revisted the harness I created and the error is still effected with:
|
I concur :) |
4 tasks
For information I had same hard to locate warning with "no-use-before-declare": true, in TSL 4.5.1 It would really help if all TSL errors were prefixed with [TSLint] or similar. |
@SteveALee open another issue for this please… |
@victornoel your mean for the prefix? |
@SteveALee yes, I meant that if you have a need for prefixing tslint messages, open another issue for that |
@victornoel please see #3060 :) |
adidahiya
pushed a commit
that referenced
this issue
Aug 2, 2017
Avoid typescript crash when trying to get type of destructured variable declaration. Also avoid walking the AST multiple times when `--declaration` is not enabled. That should result in better performance and fewer false negatives. [bugfix] `no-unused-variable` fixed crash when using destructuring Fixes: #2876 Fixes: #3001
HyphnKnight
pushed a commit
to HyphnKnight/tslint
that referenced
this issue
Apr 9, 2018
Avoid typescript crash when trying to get type of destructured variable declaration. Also avoid walking the AST multiple times when `--declaration` is not enabled. That should result in better performance and fewer false negatives. [bugfix] `no-unused-variable` fixed crash when using destructuring Fixes: palantir#2876 Fixes: palantir#3001
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug Report
TypeScript code being linted
To reproduce the problem, two files are required:
with
tslint.json
configuration:Actual behavior
An internal error within the rule occurs:
Expected behavior
TSLint should execute without internal errors and should report that
SomeClass
andname
are both unused.Additional information
The import is required to effect the internal error. If the import is omitted, no internal error occurs.
With the import, the rule follows a code path into the
getImplicitType
function and the implementations ofutils.isPropertyDeclaration
andutils.isVariableDeclaration
allow for the{ name } = person
node to be passed tochecker.getTypeAtLocation
- from within which the error is thrown.The text was updated successfully, but these errors were encountered: