It seems there are 2 tools that you can use for code formatting: Uncrustify and Prettier. I find the config for both incredibly frustrating because it has to be repeated for each org you set up. Does anyone have a workaround for this? Here's what I've tried:
With Uncrustify, the error is that it can't find the expected config file. This can be fixed by adding
"uncrustify.configPath.windows": "C:\\...Uncrustify\\uncrustify.cfg"
At this point, it does not throw this, or any, error when you run Alt+Shift+F but VS Code throws a "Command 'Format Document' Resulted In Error" error when I run >Format Document. I don't see a clear way to debug beyond this (and honestly Im pretty sick of this thing, I shouldn't have to install a binary and do their debugging to get an extension to work).
With Prettier, it sort of works out of the box. The issue is it has several settings which don't match standard VS Code: using spaces, not tabs, and setting a tab size to 2 spaces mostly.
They have settings that would change this globally, but SF Extensions add a default .prettierrc file with each new org so prettier will handle LWCs which overrides the settings. This means you have to add prettier settings in every single org you want to use this in.
I create a lot of orgs, usually a new one every couple weeks. Does anyone have any workarounds that actually allows for formatting without setting up the formatters every time?