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

Added ability to whitelist specific property/function names to use loose mode when transforming destructuring #9486

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

lvl99
Copy link

@lvl99 lvl99 commented Feb 10, 2019

Q                       A
Fixed Issues? No
Patch: Bug Fix? No
Major: Breaking Change? No
Minor: New Feature? Added selectiveLoose option for babel-plugin-transform-destructuring
Tests Added + Pass? Yes
Documentation PR Link No
Any Dependency Changes? No
License MIT

I've added an extra option called selectiveLoose to babel-plugin-transform-destructuring which can accept an array of strings which represent property or function names to destructure from. Instead of having a global loose mode, selectiveLoose allows a user to target specific property/function names.

This was a solution based on a specification by @gaearon, further elucidated by this PR by @eivind88 and comment by @Pajn.

@babel-bot
Copy link
Collaborator

babel-bot commented Feb 10, 2019

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/10148/

@lvl99
Copy link
Author

lvl99 commented Feb 17, 2019

Have updated based on rubber ducking here: facebook/create-react-app#5997 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants