Created
October 17, 2026 13:15
-
-
Save myrosblog/1da20cfeec4507e05aa023f77ac47cae to your computer and use it in GitHub Desktop.
Adobe Campaign - Prettier
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Garantees consistent formatting of Adobe Campaign code pulled with `acc` with Prettier. | |
| * | |
| * `acc instance pull` writes what the SOAP call returned, so a .meta.xml is a | |
| * single line. Formatting is what makes it ready for git & edition. | |
| * | |
| * @version 2.0.0 | |
| * @author myrosblog.com | |
| * @see https://myrosblog.com/adobe-campaign/acc-cli/qa-prettier | |
| */ | |
| export default { | |
| endOfLine: "auto", // the instance may run on Windows or on Linux. "auto" keeps existing line endings | |
| plugins: ["@prettier/plugin-xml"], // mandatory to format xml files | |
| overrides: [ | |
| // XML config | |
| { | |
| files: ["*.meta.xml"], | |
| options: { | |
| parser: "xml", // uses `@prettier/plugin-xml` | |
| printWidth: 120, // attributes may be long, 120 gives enough space | |
| xmlWhitespaceSensitivity: "ignore", // don't preserve whitespace | |
| xmlSelfClosingSpace: true, // TBD | |
| }, | |
| }, | |
| // JS config | |
| { | |
| files: ["*.js"], | |
| options: { | |
| trailingComma: "es5", // allow trailing comma in arrays and objects, but not in function calls | |
| }, | |
| }, | |
| // Note: no overrides for *.xml as they contain source code | |
| // i.e. schema & input form must not be formatted | |
| ], | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment