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
New Refactoring: Add Braces to JSX Attribute #61
Labels
Comments
nicoespeon
added
✨ Feature
New refactoring or feature
👋 Good first issue
Good for newcomers
labels
Dec 25, 2019
timvancleef
pushed a commit
to timvancleef/abracadabra
that referenced
this issue
Jan 16, 2020
timvancleef
pushed a commit
to timvancleef/abracadabra
that referenced
this issue
Jan 16, 2020
timvancleef
pushed a commit
to timvancleef/abracadabra
that referenced
this issue
Jan 16, 2020
timvancleef
pushed a commit
to timvancleef/abracadabra
that referenced
this issue
Jan 16, 2020
…g multiple attributes and components
timvancleef
pushed a commit
to timvancleef/abracadabra
that referenced
this issue
Jan 20, 2020
timvancleef
pushed a commit
to timvancleef/abracadabra
that referenced
this issue
Jan 20, 2020
timvancleef
pushed a commit
to timvancleef/abracadabra
that referenced
this issue
Jan 20, 2020
timvancleef
pushed a commit
to timvancleef/abracadabra
that referenced
this issue
Jan 20, 2020
…g multiple attributes and components
Implemented in #70 that got merged. This refactoring will be shipped in the next release, thanks to @timvancleef 🎉 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is this request related to a problem? Please describe.
Sometimes, I need to transform a primitive JSX attribute into an expression. To do so, I need to wrap the attribute with braces. I'd be nice if Abracadabra could do it for me.
Describe the solution you'd like
With following code:
If my cursor is on the
title="Hello"
attribute, I'd like to propose a quick fix to add braces around:Additional context
The difference between these 2 snippets in terms of AST is a JSXExpressionContainer.
First AST is:
Second AST is:
So we need to put the
value
of the attribute into aJSXExpressionContainer
if it's not already.The text was updated successfully, but these errors were encountered: