Scan your whole stack
Are you using prettier-plugin-xml-salesforce?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v1.1.0
prettier-plugin-xml-salesforce was last scanned on 1 Dec 2026 at version 1.1.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 1.1.0 LATEST | 1 Dec 2026 | No rules fired |
| 1.0.0 | 18 Sep 2026 | No rules fired |
Findings for v1.1.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 1.1.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
prettier-plugin-xml-salesforce is a prettier plugin for Salesforce XML files. prettier is an opinionated code formatter that supports multiple languages and integrates with most editors. The idea is to eliminate discussions of style in code review and allow developers to get back to thinking about code design instead.
This plugin is a an extension of @prettier/plugin-xml and should be used instead of the original plugin when working with Salesforce XML files. It supports (re-exports) all the original plugin features.
Salesforce Permission Set XML files may contain <flow> tags which grant access to specific flows. These tags require to be formatted as single-line elements to maintain proper XML structure by design. Unfortunately, the default @prettier/plugin-xml does not handle this correctly, often breaking the intended single-line format. For example:
<PermissionSet>
<flow>SomeFlowAccess</flow>
</PermissionSet>
easily becomes:
<PermissionSet>
<flow>
SomeFlowAccess;
</flow>
</PermissionSet>
This breaks the deployment of the *.permissionset-meta.xml files.
Salesforce Formula Fields and Validation Rules often contain complex formula expressions. These formulas need to be formatted in a canonical way to ensure readability and maintainability. Unfortunately, there is no default formatting for these formulas, so they must be formatted manually or retrieved and left as-is by default.
This plugin formats Salesforce formula tags in a canonical way from a less readable format to a more readable and maintainable format:
<CustomField>
<formula>AND(
ISPICKVAL ( Status__c , "quot;Active"quot;),
NOT( ISBLANK( End_Date__c) )
)</formula>
</CustomField>
<CustomField>
<formula>
AND(
ISPICKVAL(Status__c, "Active"),
NOT(ISBLANK(End_Date__c))
)
</formula>
</CustomField>
This allows easier readability and maintainability of complex Salesforce formulas within XML files. This functionality works under xmlFormulaFormat option.
The formatted body follows Prettier's printWidth, tabWidth and useTabs options. Formula tags are <formula>, <errorConditionFormula>, <validationFormula> and <defaultValue> (the latter only when it contains a formula, so plain values like true are left alone).
Formula fields in Salesforce have a character limit, and overly complex formulas may exceed this limit when formatted with additional line breaks and indentation. Developers should be aware of this limitation when using the plugin to format formula tags.
| Limit | Value |
|---|---|
| Formula Field | 4000 characters |
| Validation Rule | 3900 characters |
To run prettier with the 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-xml-salesforce
Or if you're using the yarn CLI, then add the plugin by:
yarn add --dev prettier prettier-plugin-xml-salesforce
The prettier executable is now installed and ready for use:
./node_modules/.bin/prettier --plugin=prettier-plugin-xml-salesforce --write '**/*-meta.xml'
Below are the options (from src/plugin.js) that prettier-plugin-xml-salesforce currently supports:
| API Option | CLI Option | Default | Description |
|---|---|---|---|
xmlFlowSingleLine |
--xml-flow-single-line |
true |
Format <flow>...</flow> as a single line and drop trailing ; |
xmlFormulaFormat |
--xml-formula-format |
false |
Canonically format Salesforce formula tags |
Any of these can be added to your existing prettier configuration file.
{
"plugins": ["prettier-plugin-xml-salesforce"],
"xmlFlowSingleLine": true,
"xmlFormulaFormat": true
}
Bug reports and pull requests are welcome on GitHub at https://github.com/kovdmm/prettier-plugin-xml-salesforce.
The package is available as open source under the terms of the MIT License.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.