Generator konfigurasi dan playground Prettier

Prettier ConfigPrettier Config
Memuat Prettier latest…

Referensi opsi Prettier

Setiap opsi di bawah tersedia pada generator di atas. Nilai bawaan yang ditampilkan berasal dari Prettier 3.9.6.

bracketSameLineBracket Same Line

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

Bawaan
false
Flag CLI
--bracket-same-line

bracketSpacingBracket Spacing

the spaces inside object braces, and everywhere they follow

Bawaan
true
Flag CLI
--no-bracket-spacing

objectWrapObject Wrap

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

Bawaan
"preserve"
Flag CLI
--object-wrap
Nilai yang diizinkan
preservecollapse

proseWrapProse Wrap

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

Bawaan
"preserve"
Flag CLI
--prose-wrap
Nilai yang diizinkan
alwaysneverpreserve

singleAttributePerLineSingle Attribute Per Line

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

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

singleQuoteSingle Quote

a preference Prettier overrides whenever escaping would suffer

Bawaan
false
Flag CLI
--single-quote

embeddedLanguageFormattingEmbedded Language Formatting

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

Bawaan
"auto"
Flag CLI
--embedded-language-formatting
Nilai yang diizinkan
autooff

endOfLineEnd Of Line

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

Bawaan
"lf"
Flag CLI
--end-of-line
Nilai yang diizinkan
lfcrlfcrauto

printWidthPrint Width

the width Prettier aims for, not a hard limit

Bawaan
80
Flag CLI
--print-width

tabWidthTab Width

how wide one indentation level is, in columns

Bawaan
2
Flag CLI
--tab-width

useTabsUse Tabs

tabs for indentation, and why accessibility is the strongest argument

Bawaan
false
Flag CLI
--use-tabs

htmlWhitespaceSensitivityHtml Whitespace Sensitivity

the option that stops Prettier changing how your page renders

Bawaan
"css"
Flag CLI
--html-whitespace-sensitivity
Nilai yang diizinkan
cssstrictignore

vueIndentScriptAndStyleVue Indent Script And Style

whether a Vue SFC indents inside its script and style blocks

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

arrowParensArrow Parens

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

Bawaan
"always"
Flag CLI
--arrow-parens
Nilai yang diizinkan
alwaysavoid

experimentalOperatorPositionExperimental Operator Position

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

Bawaan
"end"
Flag CLI
--experimental-operator-position
Nilai yang diizinkan
startend

experimentalTernariesExperimental Ternaries

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

Bawaan
false
Flag CLI
--experimental-ternaries

jsxSingleQuoteJsx Single Quote

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

Bawaan
false
Flag CLI
--jsx-single-quote

quotePropsQuote Props

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

Bawaan
"as-needed"
Flag CLI
--quote-props
Nilai yang diizinkan
as-neededconsistentpreserve

semiSemi

semicolons, and the ASI hazards behind the default

Bawaan
true
Flag CLI
--no-semi

trailingCommaTrailing Comma

the option that exists to make diffs smaller

Bawaan
"all"
Flag CLI
--trailing-comma
Nilai yang diizinkan
alles5none

checkIgnorePragmaCheck Ignore Pragma

lets a file opt itself out of formatting entirely

Bawaan
false
Flag CLI
--check-ignore-pragma

cursorOffsetCursor Offset

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

Bawaan
-1
Flag CLI
--cursor-offset

insertPragmaInsert Pragma

stamps a @format marker on every file Prettier formats

Bawaan
false
Flag CLI
--insert-pragma

rangeEndRange End

the exclusive end of a partial format

Bawaan
Flag CLI
--range-end

rangeStartRange Start

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

Bawaan
0
Flag CLI
--range-start

requirePragmaRequire Pragma

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

Bawaan
false
Flag CLI
--require-pragma