These are chat archives for Glavin001/atom-beautify

23rd
Oct 2015
Austin Cheney
@prettydiff
Oct 23 2015 03:40
@andrewserff would you be able to create a gist with some sample of code so that I can reproduce the problem?
Andrew Serff
@andrewserff
Oct 23 2015 14:42
@prettydiff Here you go: https://gist.github.com/andrewserff/e53d0547533c38499573 You'll see two files a "before" file of what it looks like before I format. And then an "after" file of what is looks like post-beautify-ing. I did notice it seems to do this in a .js file too. But those lines aren't very long, so I don't think it's a line length issue anymore...
The js file I saw it happen in is also a React component written in ES6 with jsx in it as well...
Austin Cheney
@prettydiff
Oct 23 2015 15:27
@andrewserff I have an option created to solve that problem: chainmethod. You can see here Glavin001/atom-beautify#524 that the option is not implemented in atom-beautify just yet, but a pull request has already been created for this at Glavin001/atom-beautify#594
@andrewserff Please feel free to test JSX code and all the Pretty Diff options at http://prettydiff.com/
Andrew Serff
@andrewserff
Oct 23 2015 15:32
@prettydiff cool, that does seem to fix the dots issue. What about the {{}} in the jsx when you reference an object? It seems like it is treating that as json
Austin Cheney
@prettydiff
Oct 23 2015 15:54
@andrewserff The code supports the concept of destructuring on to a single line even if wrapped in curly braces. To minimize the complexity and keep the logic around this feature sane I made the decision to eliminate this feature if the destructured object contains either a list or any other objects. You can see if you convert the code in question {classname} Pretty Diff will keep it all on one line.
Andrew Serff
@andrewserff
Oct 23 2015 15:57
ya, that works, but doesn't work with inline things like styles: style={{color: 'red'}}
you'd have to define each inline item as an object and then use the single curly to keep it formatted nicely.
so i guess there is a workaround...just not as nice as i'd like...
@Glavin001 any idea when you'll merge/release #524?