I'm using vim as my editor, I use eslint for linting javascript code. Before, I use js-beautify for formatting js code. But recently I found that eslint has a --fix option, which can fix normal coding style issue violate eslint rules.
I also find this post which suggests use eslint for code formatting. I feel it's a great idea, because I find it's kind of redundant to have both eslint and js-beautify. Since eslint can already detects all my coding style issues, why can't it do format for me?
there's also one drawback to have both js-beautify and eslint, that I need to adjust js-beautify to be in accordance with eslint rules. This is completely unnecessary.
But when I use eslint --fix to js file, it only do some fixing like: insert semicolon, add some space where necessary. But if my code is compressed, it won't format it nicely to human readable format.
How can I make eslint do code format as js-beautify does?
---fix.