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

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

Merged
merged 2 commits into from
Nov 30, 2017

Conversation

amcasey
Copy link
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
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
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.

None yet

2 participants