ตัวสร้างและสนามทดลองการตั้งค่า Prettier

กำลังโหลด Prettier latest…

อ้างอิงตัวเลือกของ Prettier

ทุกตัวเลือกด้านล่างใช้งานได้ในตัวสร้างด้านบน ค่าเริ่มต้นที่แสดงมาจาก Prettier 3.9.6

bracketSameLineBracket Same Line

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

ค่าเริ่มต้น
false
แฟล็ก CLI
--bracket-same-line

bracketSpacingBracket Spacing

the spaces inside object braces, and everywhere they follow

ค่าเริ่มต้น
true
แฟล็ก CLI
--no-bracket-spacing

objectWrapObject Wrap

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

ค่าเริ่มต้น
"preserve"
แฟล็ก CLI
--object-wrap
ค่าที่ใช้ได้
preservecollapse

proseWrapProse Wrap

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

ค่าเริ่มต้น
"preserve"
แฟล็ก CLI
--prose-wrap
ค่าที่ใช้ได้
alwaysneverpreserve

singleAttributePerLineSingle Attribute Per Line

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

ค่าเริ่มต้น
false
แฟล็ก CLI
--single-attribute-per-line

singleQuoteSingle Quote

ความชอบที่ Prettier จะข้ามให้เองเมื่อการ escape จะแย่ลง

ค่าเริ่มต้น
false
แฟล็ก CLI
--single-quote

embeddedLanguageFormattingEmbedded Language Formatting

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

ค่าเริ่มต้น
"auto"
แฟล็ก CLI
--embedded-language-formatting
ค่าที่ใช้ได้
autooff

endOfLineEnd Of Line

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

ค่าเริ่มต้น
"lf"
แฟล็ก CLI
--end-of-line
ค่าที่ใช้ได้
lfcrlfcrauto

printWidthPrint Width

ความกว้างที่ Prettier พยายามทำให้ได้ ไม่ใช่ขีดจำกัดตายตัว

ค่าเริ่มต้น
80
แฟล็ก CLI
--print-width

tabWidthTab Width

how wide one indentation level is, in columns

ค่าเริ่มต้น
2
แฟล็ก CLI
--tab-width

useTabsUse Tabs

tabs for indentation, and why accessibility is the strongest argument

ค่าเริ่มต้น
false
แฟล็ก CLI
--use-tabs

htmlWhitespaceSensitivityHtml Whitespace Sensitivity

the option that stops Prettier changing how your page renders

ค่าเริ่มต้น
"css"
แฟล็ก CLI
--html-whitespace-sensitivity
ค่าที่ใช้ได้
cssstrictignore

vueIndentScriptAndStyleVue Indent Script And Style

whether a Vue SFC indents inside its script and style blocks

ค่าเริ่มต้น
false
แฟล็ก CLI
--vue-indent-script-and-style

arrowParensArrow Parens

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

ค่าเริ่มต้น
"always"
แฟล็ก CLI
--arrow-parens
ค่าที่ใช้ได้
alwaysavoid

experimentalOperatorPositionExperimental Operator Position

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

ค่าเริ่มต้น
"end"
แฟล็ก CLI
--experimental-operator-position
ค่าที่ใช้ได้
startend

experimentalTernariesExperimental Ternaries

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

ค่าเริ่มต้น
false
แฟล็ก CLI
--experimental-ternaries

jsxSingleQuoteJsx Single Quote

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

ค่าเริ่มต้น
false
แฟล็ก CLI
--jsx-single-quote

quotePropsQuote Props

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

ค่าเริ่มต้น
"as-needed"
แฟล็ก CLI
--quote-props
ค่าที่ใช้ได้
as-neededconsistentpreserve

semiSemi

เซมิโคลอน และกับดัก ASI ที่อยู่เบื้องหลังค่าเริ่มต้น

ค่าเริ่มต้น
true
แฟล็ก CLI
--no-semi

trailingCommaTrailing Comma

the option that exists to make diffs smaller

ค่าเริ่มต้น
"all"
แฟล็ก CLI
--trailing-comma
ค่าที่ใช้ได้
alles5none

checkIgnorePragmaCheck Ignore Pragma

lets a file opt itself out of formatting entirely

ค่าเริ่มต้น
false
แฟล็ก CLI
--check-ignore-pragma

cursorOffsetCursor Offset

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

ค่าเริ่มต้น
-1
แฟล็ก CLI
--cursor-offset

insertPragmaInsert Pragma

stamps a @format marker on every file Prettier formats

ค่าเริ่มต้น
false
แฟล็ก CLI
--insert-pragma

rangeEndRange End

the exclusive end of a partial format

ค่าเริ่มต้น
แฟล็ก CLI
--range-end

rangeStartRange Start

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

ค่าเริ่มต้น
0
แฟล็ก CLI
--range-start

requirePragmaRequire Pragma

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

ค่าเริ่มต้น
false
แฟล็ก CLI
--require-pragma