Configure options below — the preview updates in real time.

Formatting Options

Core formatting rules that control how Prettier prints your code.

The line length that the printer will wrap on. This is not a hard limit but a guideline Prettier strives to meet.

The number of spaces per indentation level.

Use TabsIndent lines with tabs instead of spaces.
SemicolonsPrint semicolons at the ends of statements. When disabled, semicolons are only added at the beginning of lines that may introduce ASI failures.
Single QuotesUse single quotes instead of double quotes. JSX quotes ignore this setting.

Controls when properties in objects are quoted.

JSX Single QuotesUse single quotes instead of double quotes in JSX.

Print trailing commas wherever possible in multi-line comma-separated syntactic structures.

Bracket SpacingPrint spaces between brackets in object literals (e.g. { foo: bar } vs {foo: bar}).
Bracket Same LinePut the > of a multi-line HTML (HTML, JSX, Vue, Angular) element at the end of the last line instead of being alone on the next line.

Include parentheses around a sole arrow function parameter (e.g. (x) => x vs x => x).

Controls how object literals are wrapped when they exceed the print width (Prettier 3.5+).

Core & Parser Options

Options that control which parser Prettier uses and how it processes files.

Format code starting at a given character offset (inclusive). Useful for formatting a selection.

Format code ending at a given character offset (exclusive). Use Infinity to format to the end of the file.

Specify which parser to use. Generally not recommended in top-level config; Prettier auto-infers from file extensions.

Specify the file name to use to infer which parser to use. Mainly useful via CLI or API.

Require PragmaOnly format files that contain a special comment (/** @prettier */ or /** @format */) at the top.
Insert PragmaInsert a @format pragma into the first docblock comment of formatted files.
Check Ignore PragmaWhen using --check, files with the @prettier-ignore or @format-ignore pragma will not be checked.

Specific Language / Format Options

Options that affect formatting for specific languages and file types.

Controls how to wrap prose (e.g. Markdown text).

Specify the global whitespace sensitivity for HTML, Vue, Angular, and Handlebars files.

Vue Indent Script & StyleIndent the code inside <script> and <style> tags in Vue files.

Specifies the end of line (EOL) character used.

Control whether Prettier formats quoted code embedded in the file (e.g. template literals or Markdown code blocks).

Single Attribute Per LineEnforce a single attribute per line in HTML, Vue, and JSX.
Experimental TernariesUse the curious ternary formatting style, placing the question mark after the condition.

Controls where operators are placed when a binary expression breaks across lines (Prettier 3.5+).

External Ecosystem

Plugins and integrations that extend Prettier's functionality.

Third-party Prettier plugins to load. Enter package names or paths.