misogi / vscode-ruby-rubocop

Rubocop extension for Visual Studio Code
https://marketplace.visualstudio.com/items/misogi.ruby-rubocop
MIT License
137 stars 68 forks source link

Added postFormatVSCodeCommand option, so that I can use RuboCop and Prettier for Ruby at the same time #170

Closed ndbroadbent closed 2 years ago

ndbroadbent commented 2 years ago

I really like how RuboCop can fix linting issues as well as formatting the code. However, I prefer the way that Prettier for Ruby formats code since it's much more opinionated, and it does a much better job with hashes. Prettier can automatically split and indent hashes across multiple lines, but RuboCop can't do this.

I tried to switch to Prettier, but then I really missed all the extra things that RuboCop was doing for me.

This new option allows me to call prettier.forceFormatDocument from the Prettier VS Code extension to format the code after RuboCop has fixed all of the linting issues. Thanks!

ndbroadbent commented 2 years ago

Sorry please ignore this, it doesn't work quite right - the file is modified by Prettier but isn't saved