-
Notifications
You must be signed in to change notification settings - Fork 453
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
Support for JSX syntax (ReactJS) #144
Comments
No plans currently, however I am open to the idea. The current JavaScript beautifier ( js-beautify ) does not yet support JSX so we will either have to wait for js-beautify support or find / create another beautifier than can handle this. Continuation of #12 (duplicate). |
Hi! The Atom React plugin now has initial JSX reformatting support http://orktes.github.io/atom-react/#jsx-reformatting |
Can we integrate atom-react @Glavin001? |
Awesome that Atom React now supports Beautification. If someone would like to submit a Pull Request to add support for Atom Beautify I would definitely be open to merging it. See https://github.com/Glavin001/atom-beautify/pulls?q=is%3Apr+is%3Aclosed for example Pull Requests for adding new language support and applicable Atom react code at https://github.com/orktes/atom-react/blob/master/lib/atom-react.coffee#L137-L180 |
Pretty Diff supports JSX format using its jspretty, markupmin, and markup_beauty libraries. Here are some code samples to test against: http://prettydiff.com/unit_tests/beautification_javascript_jsx.txt Here is my concept of support: http://prettydiff.com/guide/react_jsx.xhtml Also, I am working on adding support for all atom-beautify supported markup based langauges/template schemes. This support is missing some minor enhancements to the code that will be completed in the next few days. |
Awesome @prettydiff !! Thank you for such great support! Let me know if there's anything I can do. I'll take a look this weekend into setting up beautifier for JSX and any others. |
Will be supported once #282 is released. |
Language config options for: - disabled - Disable beautifying a language - `disabled_languages` no longer works - use the options for each language to disable them - default_beautifier - Preferred beautifier to use for language - if there are multiple beautifiers for a language it will choose the beautifier the user has set as default. Initially the default beautifier is just the first beautifier to register support for that language
Published to v0.25.0 This is a very big release with lots of internal changes and (hopefully) no breaking changes. Please let me know if you are experiencing any unusual behaviour / breaking changes after updating. Thank you. |
When I try and beautify a .jsx file. |
@framerate looks like
|
I'm having this problem too even with a .js file |
Could you guys run command |
I want to test with the new version first. Let me know when you publish it. |
My error is this:
|
I have added Published to v0.27.2 |
Ok. I'll test this now! |
I'm still having the same issue:
|
There's no .js extension on the jsx language :( That's the problem |
Published update to v0.27.4 JSX language will be detected if:
|
@Glavin001 If I install language-babel or language-javascript-jsx then beautification broken as grammar is detected as "Babel ES6 Javascript" or "Javascript with JSX" respectively. |
@phuna In the Atom Beautify settings you can choose a beautifier for a given language. These choices are at the bottom of the settings panel in the Atom Beautify settings. Change the beautifier for regular JavaScript (Language Config - JavaScript - Default Beautifier) from JS Beautify to Pretty Diff. If that fixes your problems then you have found a JS Beautify bug and should open an issue with that project at https://github.com/beautify-web/js-beautify/issues. If that does not solve the problem then please post sample code to a gist so that we can investigate this further. |
@prettydiff you're correct, changing to Pretty Diff gives much better result. It seems that's a JS Beautify problem. I've just checked their issue list and I see similar problem already reported 12 days ago: beautifier/js-beautify#834 |
Hi.
I think, it's hard to implement, but would be useful for a lot of people.
Have you this in plans?
The text was updated successfully, but these errors were encountered: