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

[Traversals] Add findInScope #13

Closed
cpojer opened this issue May 23, 2015 · 1 comment
Closed

[Traversals] Add findInScope #13

cpojer opened this issue May 23, 2015 · 1 comment

Comments

@cpojer
Copy link
Contributor

cpojer commented May 23, 2015

A findInScope method would only pattern match one scope level deep, beginning from the scope it was called on.

This is useful to find identifiers on a specific level in the AST, for example arguments or this inside of a function/method.

Examples where I did this manually or worked around this problem:
cpojer/js-codemod@7502159
cpojer/js-codemod@a20a5e1

@cpojer cpojer changed the title Add findInScope [Traversals] Add findInScope May 23, 2015
@fkling
Copy link
Contributor

fkling commented Jul 28, 2015

This can currently be solved via collection.closestScope().find(...). Do we need an additional method for that?

@cpojer cpojer closed this as completed Jul 28, 2015
euphocat pushed a commit to euphocat/jscodeshift that referenced this issue Oct 22, 2017
create-element-to-jsx-children: Convert primitive attribute values properly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants