-
Notifications
You must be signed in to change notification settings - Fork 12
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 line indentation #1
Comments
i’m glad it’s useful for you!
i don’t know, but maybe we can find out together. do you know how babel/ESTree represents whitespace? |
Unfortunately, nope. |
so you say <ol>
<li>a</li>
<li>b</li>
</ol> gets converted to <ol><li>a</li><li>b</li></ol> or what? |
I mean React.createElement("ul", React.createElement("li")) converts to
not
|
well, that’s correct, no? React.createElement("ul",
React.createElement("li")
) should convert to <ul>
<li></li>
</ul> or similar. |
It's not just JSX. I noticed that it did this for simple arrays also. I tried with a simple example: Before: let my_list = [
"one",
"two",
"three",
"four"
]; after: let my_list = ["one", "two", "three", "four"]; |
huh? that’s really weird, as i only replace nodes that pass all the checks (i.e. are is what you observe inside of such an expression or will a file containing only what you showed me be transformed like that? |
Only what I showed you. It's a file containing only an array |
Adding the following to the test file will reproduce this: it('should ignore regular javascript arrays', () => {
let source = `
let list = [
"one",
"two",
"three",
]
`
expect(source).to.convertTo(source)
}) results in:
I'll try to debug further, to see if I can't get to the bottom of it. |
Further investigation shows that this is a problem with babel itself. I can reproduce it by running babel without any plugin options. Using the before let foo = [
'one',
'two',
'three'
]; after let foo = [
'one',
'two',
'three']; |
OK, so it’s not actually a bug and i can close it, right? |
I should think so |
OK, thanks for investigating! |
Huge thanks for you for this plugin!
I found just one drawback. Plugin pose all
JSX
tags just in one line. How can I avoid it?The text was updated successfully, but these errors were encountered: