Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improvement(snap), enable auto-formatting components before snap/tag #9497

Merged
merged 2 commits into from
Jan 27, 2025

Conversation

davidfirst
Copy link
Member

Added a new slot onPreSnap for snapping aspect, which the formatter aspect registered to. Before snapping the components, the formatter checks the config of formatOnPreSnap and if enabled it formats the modified components. It skips the auto-tag components as they don't have code modifications.

The reason for not adding it as a build-task is because it makes changes to the source files. It doesn't add metadata as any other build task. We want it to run locally according to the user workspace.jsonc config and regardless whether the user is running the build on the cloud or not.

To enable it, simply add the following to your workspace.jsonc file:

"teambit.defender/formatter": {
    "formatOnPreSnap": true
  }

@davidfirst davidfirst enabled auto-merge (squash) January 27, 2025 20:17
@davidfirst davidfirst merged commit 2bcd08c into master Jan 27, 2025
10 checks passed
@davidfirst davidfirst deleted the format-on-pre-snap branch January 27, 2025 21:10
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.

2 participants