Multi Format Extension
VisualStudio Code Extension
About the Extension
With this extension you'll be able to use more than one formatter for the same language, which make it easier to keep your code as neat as possible when one formatter do different things than others. For example, you could run three formatters in a row—Prettier, Eslint and Visual Studio Code—in just one run and in the order you prefer to get the best results.
You can find the extension in the Visual Studio Code extension store; you can build it and install it yourself by running following commands:
After the extension is installed, you'll need to configure two things: the languages you want to enable multi-format support for, and the formatters to run for each language.
To accomplish the first task, set a key-value pair that identifies the languages you want this extension to be activated on:
Then, you'd define the formatters you want to run per-language:
In this example,
Running the extension
Whenever you save a document, the MultiFormat extension will run your formatters for you. There are additionally two more ways to run the extension.
Using it as language formatter
This extension will appear as a formatter for the supported languages, so you'll be able to run it using the VSCode integrated features like the shortcut
Running extesion defined actions
This extesion comes with two actions that you can configure however you want and add the shortcuts you want, so they can run appart of the formatter itself. Their names are