JavaScriptTypeScript Bun Build OptimizationDeveloper Tools DevelopmentTool Development 1 min read

Bun Adds Built-in Code Formatter for Faster JavaScript Workflows

Bun is introducing a native code formatter that significantly outperforms Prettier while reducing dependency overhead in JavaScript and TypeScript projects.

Bun version 1.x (or the next release) will include a built-in code formatter named bun fmt.

This tool functions as an alternative to Prettier. It performs formatting tasks approximately 320 times faster than the existing solution.

By integrating the formatter directly into the CLI, the project reduces dependencies needed for standard JavaScript and TypeScript development workflows. Teams can handle code styling without installing third-party packages or managing separate configuration files.

The implementation targets the latency often associated with large-scale project linting and formatting. The update ships as part of the standard Bun distribution, making the tool available to users immediately upon upgrading.