Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrectly marking a declaration as unused #98782

Closed
andokai opened this issue May 29, 2020 · 4 comments
Closed

Incorrectly marking a declaration as unused #98782

andokai opened this issue May 29, 2020 · 4 comments
Assignees
Labels
javascript JavaScript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@andokai
Copy link

andokai commented May 29, 2020

Apologies if this is the wrong repo for this.

  • VSCode Version: 1.45.1
  • OS Version: Windows 10 & macOS

Steps to Reproduce:

The issue can be observed on CodeSandbox which I guess uses the same underlying code.
https://codesandbox.io/s/lucid-http-qscl0?file=/src/App.js

CancelToken is being marked as an unused declaration when it clearly isn't and applying the quick fix breaks the code.

Does this issue occur when all extensions are disabled?: Yes

@mjbvz mjbvz self-assigned this May 29, 2020
@mjbvz
Copy link
Contributor

mjbvz commented May 29, 2020

Does this reproduce in the latest VS Code insiders build with all extensions disabled?

@mjbvz mjbvz added the info-needed Issue requires more information from poster label May 29, 2020
@andokai
Copy link
Author

andokai commented May 29, 2020

Does this reproduce in the latest VS Code insiders build with all extensions disabled?

Yes it does

@mjbvz
Copy link
Contributor

mjbvz commented May 29, 2020

This is a bug with the typings that axios is shipping

If you enable type checking in the JS file, you'll see the error on new CancellationToken:

'CancelToken' only refers to a type, but is being used as a value here.ts(2693)

If your code is correct, please file a bug against axios to have them fix their typings

@mjbvz mjbvz closed this as completed May 29, 2020
@mjbvz mjbvz added upstream Issue identified as 'upstream' component related (exists outside of VS Code) javascript JavaScript support issues and removed info-needed Issue requires more information from poster labels May 29, 2020
@andokai
Copy link
Author

andokai commented May 29, 2020

No worries, thanks for investigating!

@github-actions github-actions bot locked and limited conversation to collaborators Jul 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
javascript JavaScript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

2 participants