Prettier-Konfigurationsgenerator und Playground

Prettier latest wird geladen…

Prettier-Optionsreferenz

Jede Option unten steht im Generator oben zur Verfügung. Die gezeigten Standardwerte stammen aus Prettier 3.9.6.

bracketSameLineBracket Same Line

where the closing angle bracket of a multi-line tag lands

Standard
false
CLI-Flag
--bracket-same-line

bracketSpacingBracket Spacing

the spaces inside object braces, and everywhere they follow

Standard
true
CLI-Flag
--no-bracket-spacing

objectWrapObject Wrap

Prettier's one deliberate escape hatch, and how to switch it off

Standard
"preserve"
CLI-Flag
--object-wrap
Zulässige Werte
preservecollapse

proseWrapProse Wrap

how Markdown paragraphs are wrapped, and why the default leaves them alone

Standard
"preserve"
CLI-Flag
--prose-wrap
Zulässige Werte
alwaysneverpreserve

singleAttributePerLineSingle Attribute Per Line

one attribute per line, for markup diffs that read like code diffs

Standard
false
CLI-Flag
--single-attribute-per-line

singleQuoteSingle Quote

a preference Prettier overrides whenever escaping would suffer

Standard
false
CLI-Flag
--single-quote

embeddedLanguageFormattingEmbedded Language Formatting

formatting the CSS, HTML and GraphQL hiding inside your template literals

Standard
"auto"
CLI-Flag
--embedded-language-formatting
Zulässige Werte
autooff

endOfLineEnd Of Line

line endings, and the Windows diff problem this option was created to end

Standard
"lf"
CLI-Flag
--end-of-line
Zulässige Werte
lfcrlfcrauto

printWidthPrint Width

the width Prettier aims for, not a hard limit

Standard
80
CLI-Flag
--print-width

tabWidthTab Width

how wide one indentation level is, in columns

Standard
2
CLI-Flag
--tab-width

useTabsUse Tabs

tabs for indentation, and why accessibility is the strongest argument

Standard
false
CLI-Flag
--use-tabs

htmlWhitespaceSensitivityHtml Whitespace Sensitivity

the option that stops Prettier changing how your page renders

Standard
"css"
CLI-Flag
--html-whitespace-sensitivity
Zulässige Werte
cssstrictignore

vueIndentScriptAndStyleVue Indent Script And Style

whether a Vue SFC indents inside its script and style blocks

Standard
false
CLI-Flag
--vue-indent-script-and-style

arrowParensArrow Parens

parentheses around a lone arrow parameter, and the edit cost of leaving them off

Standard
"always"
CLI-Flag
--arrow-parens
Zulässige Werte
alwaysavoid

experimentalOperatorPositionExperimental Operator Position

whether a wrapped operator trails the line above or leads the line below

Standard
"end"
CLI-Flag
--experimental-operator-position
Zulässige Werte
startend

experimentalTernariesExperimental Ternaries

an opt-in answer to Prettier's longest-running formatting argument

Standard
false
CLI-Flag
--experimental-ternaries

jsxSingleQuoteJsx Single Quote

quote style for JSX attributes, kept separate from your JavaScript strings

Standard
false
CLI-Flag
--jsx-single-quote

quotePropsQuote Props

when object keys get quoted, and the consistency option most people want

Standard
"as-needed"
CLI-Flag
--quote-props
Zulässige Werte
as-neededconsistentpreserve

semiSemi

semicolons, and the ASI hazards behind the default

Standard
true
CLI-Flag
--no-semi

trailingCommaTrailing Comma

the option that exists to make diffs smaller

Standard
"all"
CLI-Flag
--trailing-comma
Zulässige Werte
alles5none

checkIgnorePragmaCheck Ignore Pragma

lets a file opt itself out of formatting entirely

Standard
false
CLI-Flag
--check-ignore-pragma

cursorOffsetCursor Offset

the option that stops format-on-save losing your place

Standard
-1
CLI-Flag
--cursor-offset

insertPragmaInsert Pragma

stamps a @format marker on every file Prettier formats

Standard
false
CLI-Flag
--insert-pragma

rangeEndRange End

the exclusive end of a partial format

Standard
CLI-Flag
--range-end

rangeStartRange Start

the start of a partial format, and how Format Selection actually works

Standard
0
CLI-Flag
--range-start

requirePragmaRequire Pragma

the option that lets a huge codebase adopt Prettier one file at a time

Standard
false
CLI-Flag
--require-pragma