Skip to content

#2640 Upgrade formatting to prettier-plugin-sfmc - #2641

Merged
JoernBerkefeld merged 2 commits into
developfrom
2640-feature-upgrade-to-prettier-plugin-sfmc
Sep 6, 2026
Merged

JoernBerkefeld merged 2 commits into
developfrom
2640-feature-upgrade-to-prettier-plugin-sfmc

Conversation

@JoernBerkefeld

Copy link
Copy Markdown
Contributor

Summary

  • route AMPscript, SSJS, SQL, HTML, JSON, and other supported output through Prettier with prettier-plugin-sfmc, replacing the legacy Beauty AMP and SQL formatter dependencies/APIs
  • preserve safe filepath-based parser inference, with unsupported or unresolved file types passed through unchanged rather than failing output generation
  • remove obsolete formatter configuration while keeping project-specific overrides and the Beauty AMP VS Code extension in unwantedRecommendations
  • require Node.js 22.13+ (or 24+) for the new formatter stack
  • add a transactional v10 project-upgrade migration that replaces formatter dependencies/config and removes .beautyamp.json without persisting a partial upgrade on failure
  • update generated declarations, formatter call sites, snapshots, and focused coverage across metadata output types

Breaking changes

  • Node.js 20 and 21 are no longer supported; Node.js 22.13+ or 24+ is required
  • the legacy Beauty AMP formatter helpers and configuration files are removed
  • generated boilerplate uses prettier-plugin-sfmc defaults instead of duplicating global useTabs, tabWidth, printWidth, singleQuote, and trailingComma options

Verification

  • npm run lint --no-workspaces — passed with zero warnings
  • npm run lint-ts --no-workspaces — passed
  • npx mocha test/formatter.test.js --reporter dot — 22 passing
  • git diff --check — passed
  • latest full suite before final staging-only reconciliation: 385 passing, 16 pending, exit 0
  • commit hooks (lint-staged plus declaration generation/type validation) — passed

Release note

The package version remains 9.0.3. The planned v10.0.0 version bump, tag, publish, and GitHub release are intentionally deferred because additional features will land before v10 is released.

@github-actions

github-actions Bot commented Sep 6, 2026 •

Copy link
Copy Markdown

Coverage Report

Commit:721c532
Base: develop@e6df458

Type Base This PR
Total Statements Coverage  71.84%  73.03%  (+1.19%)
Total Branches Coverage  71.44%  71.77%  (+0.33%)
Total Functions Coverage  83.94%  85.67%  (+1.73%)
Total Lines Coverage  71.84%  73.03%  (+1.19%)
Details (changed files):
File Statements Branches Functions Lines
lib/metadataTypes/Automation.js  77.68%  70.47%  91.17%  77.68%
lib/metadataTypes/DataExtension.js  78.99%  71.15%  94.59%  78.99%
lib/metadataTypes/Event.js  55.84%  44.89%  68.18%  55.84%
lib/metadataTypes/Folder.js  73.4%  66.37%  100%  73.4%
lib/metadataTypes/ImportFile.js  67.43%  56.6%  90.9%  67.43%
lib/metadataTypes/MetadataType.js  85.28%  82.03%  77.27%  85.28%
lib/metadataTypes/SenderProfile.js  89.37%  73.8%  100%  89.37%
lib/metadataTypes/TransactionalSMS.js  83.92%  69.56%  81.81%  83.92%
lib/util/file.js  87.43%  76.13%  94.44%  87.43%
lib/util/init.config.js  63.48%  66.07%  100%  63.48%
lib/util/init.js  27.55%  80%  14.28%  27.55%
lib/util/init.npm.js  78.12%  81.81%  100%  78.12%
lib/util/util.js  86.4%  76.41%  92.45%  86.4%
lib/util/validations.js  85.88%  77.77%  87.5%  85.88%

Comment thread boilerplate/forcedUpdates.json Outdated
[
{
"version": "10.0.0",
"files": [".prettierrc"],

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to include ".vscode/settings.json" as well

@JoernBerkefeld JoernBerkefeld added this to the 10.0.0 milestone Sep 6, 2026
@JoernBerkefeld JoernBerkefeld linked an issue Sep 6, 2026 that may be closed by this pull request
@JoernBerkefeld
JoernBerkefeld merged commit 565b729 into develop Sep 6, 2026
7 checks passed
@JoernBerkefeld
JoernBerkefeld deleted the 2640-feature-upgrade-to-prettier-plugin-sfmc branch September 6, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] upgrade to prettier-plugin-sfmc

1 participant