[Fixes #174] implement no-shadowed-variable converter #218
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist
status: accepting prs
Overview
I added a converter between tslint's
no-shadowed-variable
rule and eslint'sno-shadow
rule. Tslint'sno-shadowed-variable
's default behavior corresponds to eslint'sno-shadow
with thehoist
option set toall
.no-shadow
'shost
option can be switched tonever
when tslint'sno-shadowed-variable
has a configuration object withtemporalDeadZone
set tofalse
.If
no-shadowed-variable
is configured to disable checking forunderscore
, 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 useno-shadow
'sallow
config instead, if they want to disable checking for specific variables.Finally, if
no-shadowed-variable
is set to disable checks for anything other thantemporalDeadZone
andunderscore
(e.g.class
,function
, etc.), a notice saying that eslint doesn't support disabling checks based on declaration type is shown.Reference: