-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
Re-enable the unused variables tslint rule for the hygiene task fixes #42157 #42831
Conversation
@egamma Looks good. Should we still keep the old tslint filter on the |
The unused variable rule requires that linting is done in the context of a project. Currently the only project that hygiene knows about is the src project. It would be possible to add know how about the other projects in the test and extensions folder:
Thinking about this again we should also run hygiene/tslint on the extensions. I´ll look into it. |
@joaomoreno enabled linting of extensions and tests. Gave a heads-up to extension owners to enable the noUnusedLocals in the tsconfig.json. |
Looks good to me! |
@egamma @joaomoreno fyi after this change landed I feel that git-commit takes easily 3-5 times as long as before, could that be related? |
@bpasero @joaomoreno the slow down is caused by tslint creating a project for the changed files, so that the Since the goal is that the hygiene check is fast this setup takes too long and we should roll back and not create a program context for running tslint. |
@egamma as someone that commits very often right after making a change, I really cannot work with this new behaviour and would like to disable it. |
@bpasero agreed I´ve disabled it. |
Thanks 👍 |
Too bad... I think we're just going to have to bite unused variables as compiler errors, which we don't prevent from committing right now anyway. |
This Pull request enables the tslint rule for unused-variables. This is done by performing the tslint checks in the context of a Typescript program/project with the tslint rule for unused-variables enabled. Since the checks have to be done in the context of a TS project I currently define the
src
folder to be this project, this means extensions and tests are no longer tslinted as part of the hygiene.The tslint rule had some false positive issues in the tslint version 5.8, so this PR also updates tslint to version 5.9.