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

Incorrect no-shadow-variable failures when using mockTypeScriptVersion #65

Closed
andyrooger opened this issue Apr 16, 2018 · 0 comments
Closed

Comments

@andyrooger
Copy link

andyrooger commented Apr 16, 2018

With 0.9.9 released, I've finally got around to replacing my local workaround for #58 with the proper fix - turning on mockTypeScriptVersion.

Unfortunately this results in almost every variable being incorrectly flagged as failing the no-shadow-variable rule. That's ~58000 errors in the project I'm working on. This is something I didn't see when testing the original PR, so I'm not sure what's changed.

To reproduce:

  • Set up tslint-language-service in Visual Studio 2017 with TypeScript Tools for Microsoft Visual Studio installed
  • Make sure the typescript version in the project's node_modules is different to the one included in the VS TypeScript Tooling
  • Turn on the mockTypeScriptVersion option in the plugin
  • Open a TS file in VS

This should result in most variables (especially any imports or exports) being flagged as shadowing themselves.

It looks like this is caused by loading tslint twice (require then mockRequire.reRequire), though I'm not sure why this is the case.

andyrooger pushed a commit to andyrooger/tslint-language-service that referenced this issue Apr 16, 2018
andyrooger pushed a commit to andyrooger/tslint-language-service that referenced this issue Apr 16, 2018
@andyrooger andyrooger changed the title Incorrect no-shadow-variable failures when using mockTypeScriptVersion Incorrect no-shadow-variable failures when using mockTypeScriptVersion Apr 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant