Using Formatters

Use the unified formatter CLI, UI and API, to run the different formatters your workspace components use.

Formatters style your code to make it "cleaner", clearer and more consistent. Having your team's code formatted automatically, saves time otherwise wasted on discussions and code reviews about code styling.

Run the following to format all components in your workspace:

$bit
Copiedcopy

Run the following to format only new or modified components in your workspace:

$bit
Copiedcopy

Run the following to format a specific component:

$bit
Copiedcopy

Check for unformatted components

Run the following to check for components that needs to be formatted:

$bit
Copiedcopy

The output is similar to the following:

my-org.my-scope/ui/text
issues found in the following files:
text.composition.tsx
text.tsx
Formatting during build

The formatter does not run during the build process. As a general rule, the build process should not modify your components' source code.