-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
js2-jsx-mode - Issue with intendation after code block in jsx #490
Comments
Indentation problems with JSX are known and expected, and so far there are more reports than people interested in fixing them (sorry). |
@kbrah I've found that wrapping the contents of the |
P.S. @dgutov have you thought about removing E4X from |
I'm seeing this with rjsx-mode 20180625.58 which pulls in js2-mode 20180605.1425 (from melpa) and I still see this issue every time I use a map on an array to generate a list. Eg. this:
becomes this if I reindent
And this
becomes this if I reindent
Is this something that would be fixed by the above commits and will be available in a later release? Is there a workaround/practice that would avoid this issue? Thanks! |
I've figured out that the fat-arrow functions are the culprit. If I remove the fat-arrow functions, formatting is back to normal (but of course, the resulting code doesn't work...:-) ). And I've found a workaround: turning the problem spots into react Components. Curiously none of these components have formatting problems. Her's an example component that formats OK:
|
The identation PR hasn't been merged yet. |
I'm having a problem with intendation in js2-jsx-mode. The problem occurs when there is jsx next to a code block
expected:
actual behavior:
I'm using spacemacs and emacs v25.3 on Windows.
Is this a known issue or am I doing something wrong? (I'm fairly new to the emacs world)
The text was updated successfully, but these errors were encountered: