Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Converted react-unused-props-and-state to use a walk function. #720

Merged
merged 1 commit into from
Dec 30, 2018
Merged

Converted react-unused-props-and-state to use a walk function. #720

merged 1 commit into from
Dec 30, 2018

Conversation

reduckted
Copy link
Contributor

PR checklist

Overview of change:

Converted react-unused-props-and-state to use a walk function.

Is there anything you'd like reviewers to focus on?

This one's a bit odd because it sort of does two passes over the AST. It walks everything once, but doesn't step down on ClassDeclaration nodes. Then it does a "second pass" by stepping down on the ClassDeclaration nodes it saw in the first pass. I considered splitting it up into two separate callback functions, but I wasn't sure exactly what's expected to be visited on the first pass and what's visited on the second pass, so I just used one callback function which is the equivalent of what the walker class did.

@JoshuaKGoldberg
Copy link

Thanks for the notes - seems fine the way you have it. This is kind of a spooky rule.

@JoshuaKGoldberg JoshuaKGoldberg merged commit 7fdda10 into microsoft:master Dec 30, 2018
@reduckted reduckted deleted the 680/react-unused-props-and-state branch December 30, 2018 10:12
@IllusionMH IllusionMH added this to the 6.1.0-beta milestone Feb 19, 2019
apawast pushed a commit to lupine86/tslint-microsoft-contrib that referenced this pull request Feb 26, 2019
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.

3 participants