JavaScript Formatter
Format JavaScript with Prettier standalone's Babel parser.
How to use
- Enter JavaScript source and run the formatter.
Capabilities and scope
The Babel and estree plugins are lazy-loaded so indentation, line wrapping, and related syntax formatting are driven by parsed code structure.
How it works
prettier.format is called with parser:'babel' and the babel/estree plugins.
Example
A dense object declaration is expanded according to Prettier's default style.
Useful for
- Prepare a JavaScript snippet for easier review
Before you use it
- It does not lint, type-check, execute code, or load a project's custom Prettier configuration.
Frequently asked questions
Does it find programming bugs?
No. Parsing can fail on invalid syntax, but this is a formatter rather than a static analyzer.