Keep formatting consistent across the extension codebase with minimal manual effort. Prettier runs from scripts, editor integration, and continuous integration (CI). It does not run inside the Extension.js build pipeline.Documentation Index
Fetch the complete documentation index at: https://extension.js.org/llms.txt
Use this file to discover all available pages before exploring further.
When Prettier is a good fit
- You want deterministic formatting in local and CI workflows.
- You are onboarding contributors and need low-friction style consistency.
- You want ESLint to focus on correctness while Prettier handles formatting.
Prettier capabilities
| Capability | What it gives you |
|---|---|
| Consistent formatting | One shared style for JS, TS, JSON, CSS, and Markdown |
| Script and editor workflow | Format on save locally and enforce in CI |
| Lint conflict reduction | Pair with eslint-config-prettier to avoid rule overlap |
| Low-maintenance defaults | Adopt a stable baseline with minimal configuration |
Template examples
Prettier configuration template
Preconfigured formatter setup for new projects.
Usage with an existing extension
Install Prettier: Create a configuration file (for example,.prettierrc):
Integration with ESLint
To avoid formatting-rule conflicts in ESLint, install: Then addeslint-config-prettier in your ESLint configuration chain so ESLint defers formatting concerns to Prettier.
Best practices
- Keep formatting automatic in editor and CI, not manual.
- Use
--checkin CI and--writelocally. - Format staged files pre-commit in larger repositories.

