/prettier-plugin-sf-xml

@prettier/plugin-sf-xml is a prettier plugin for Salesforce XML Metadata

Primary LanguageTypeScript

Prettier for Salesforce Metadata XML

prettier-plugin-sf-xml is a prettier plugin for Salesforce Metadata XML.

This plugin uses a modified version of the swagup-com/sf-xml-formatter xml file sorting algorithm with new features to adapt to the original Salesforce files such as respecting the tag order and add custom indentation through the prettier tabWidth and useTab options.

Getting started

To run prettier with the Salesforce Metadata XML plugin, you're going to need node.

If you're using the npm CLI, then add the plugin by:

npm install --save-dev prettier prettier-plugin-sf-xml

Or if you're using yarn, then add the plugin by:

yarn add --dev prettier prettier-plugin-sf-xml

The prettier executable is now installed and ready for use:

./node_modules/.bin/prettier --write '**/*.xml'