Multi Format ExtensionVisualStudio Code Extension About the ExtensionWith 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. InstallationYou can find the extension in the Visual Studio Code extension store; you can build it and install it yourself by running following commands:
Where ConfigurationAfter 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: the order in which the formatters will run, so, for example for JavaScript and PHP you can add the following to your
In this example, Running the extensionWhenever 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 formatterThis 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 actionsThis 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 LicenseThis code is licensed under GNU GPLv3, and was originally forked from https://github.com/jota0222/MultiFormatterVSCode. |