Skip to content

Don't offer to prepend an underscore to the name of an unused private property#20373

Merged
amcasey merged 2 commits into
microsoft:masterfrom
amcasey:PropertyUnderscore
Nov 30, 2017
Merged

Don't offer to prepend an underscore to the name of an unused private property#20373
amcasey merged 2 commits into
microsoft:masterfrom
amcasey:PropertyUnderscore

Conversation

@amcasey
Copy link
Copy Markdown
Member

@amcasey amcasey commented Nov 30, 2017

Underscores only help with unused parameters.

@amcasey amcasey requested a review from aozgaa November 30, 2017 18:24
return [functionDeclaration.parameters.length === 1 ? deleteNode(parent) : deleteNodeInList(parent),
prefixIdentifierWithUnderscore(identifier)];
const deleteAction = functionDeclaration.parameters.length === 1 ? deleteNode(parent) : deleteNodeInList(parent);
return errorCode === Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

isParameterPropertyDeclaration(identifier) instead of looking at the code.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

My feeling was that the code might be applied to other symbols in the future but that it's inherently about properties so it was a valid way to perform the check.

@amcasey amcasey merged commit 8f1cdc9 into microsoft:master Nov 30, 2017
@amcasey amcasey deleted the PropertyUnderscore branch November 30, 2017 21:08
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants