Skip to content

[Fixes #174] implement no-shadowed-variable converter #218

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

Merged

Conversation

alejo90
Copy link
Contributor

@alejo90 alejo90 commented Oct 6, 2019

PR Checklist

Overview

I added a converter between tslint's no-shadowed-variable rule and eslint's no-shadow rule. Tslint's no-shadowed-variable's default behavior corresponds to eslint's no-shadow with the hoist option set to all. no-shadow's host option can be switched to never when tslint's no-shadowed-variable has a configuration object with temporalDeadZone set to false.
If no-shadowed-variable is configured to disable checking for underscore, a notice is shown explaining that eslint does not support disabling checking on whether a variable name starts with underscore or not and asking users to use no-shadow's allow config instead, if they want to disable checking for specific variables.
Finally, if no-shadowed-variable is set to disable checks for anything other than temporalDeadZone and underscore (e.g. class, function, etc.), a notice saying that eslint doesn't support disabling checks based on declaration type is shown.

Reference:

@alejo90 alejo90 force-pushed the no-shadowed-variable branch from 12c0ab4 to e1cb0c4 Compare October 6, 2019 15:52
@JoshuaKGoldberg JoshuaKGoldberg added the status: waiting for reviewer Waiting for a maintainer to review label Oct 6, 2019
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amusing differences in rule settings. Thanks!

@JoshuaKGoldberg JoshuaKGoldberg merged commit d17fb1b into typescript-eslint:master Oct 6, 2019
@JoshuaKGoldberg JoshuaKGoldberg removed the status: waiting for reviewer Waiting for a maintainer to review label Oct 10, 2019
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

Successfully merging this pull request may close these issues.

Missing converter: no-shadowed-variable
2 participants