Trình tạo cấu hình và playground Prettier

Đang tải Prettier latest…

Tham chiếu tuỳ chọn Prettier

Mọi tuỳ chọn bên dưới đều có trong trình tạo ở trên. Giá trị mặc định hiển thị lấy từ Prettier 3.9.6.

bracketSameLineBracket Same Line

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

Mặc định
false
Cờ CLI
--bracket-same-line

bracketSpacingBracket Spacing

the spaces inside object braces, and everywhere they follow

Mặc định
true
Cờ CLI
--no-bracket-spacing

objectWrapObject Wrap

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

Mặc định
"preserve"
Cờ CLI
--object-wrap
Giá trị hợp lệ
preservecollapse

proseWrapProse Wrap

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

Mặc định
"preserve"
Cờ CLI
--prose-wrap
Giá trị hợp lệ
alwaysneverpreserve

singleAttributePerLineSingle Attribute Per Line

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

Mặc định
false
Cờ CLI
--single-attribute-per-line

singleQuoteSingle Quote

a preference Prettier overrides whenever escaping would suffer

Mặc định
false
Cờ CLI
--single-quote

embeddedLanguageFormattingEmbedded Language Formatting

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

Mặc định
"auto"
Cờ CLI
--embedded-language-formatting
Giá trị hợp lệ
autooff

endOfLineEnd Of Line

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

Mặc định
"lf"
Cờ CLI
--end-of-line
Giá trị hợp lệ
lfcrlfcrauto

printWidthPrint Width

the width Prettier aims for, not a hard limit

Mặc định
80
Cờ CLI
--print-width

tabWidthTab Width

how wide one indentation level is, in columns

Mặc định
2
Cờ CLI
--tab-width

useTabsUse Tabs

tabs for indentation, and why accessibility is the strongest argument

Mặc định
false
Cờ CLI
--use-tabs

htmlWhitespaceSensitivityHtml Whitespace Sensitivity

the option that stops Prettier changing how your page renders

Mặc định
"css"
Cờ CLI
--html-whitespace-sensitivity
Giá trị hợp lệ
cssstrictignore

vueIndentScriptAndStyleVue Indent Script And Style

whether a Vue SFC indents inside its script and style blocks

Mặc định
false
Cờ CLI
--vue-indent-script-and-style

arrowParensArrow Parens

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

Mặc định
"always"
Cờ CLI
--arrow-parens
Giá trị hợp lệ
alwaysavoid

experimentalOperatorPositionExperimental Operator Position

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

Mặc định
"end"
Cờ CLI
--experimental-operator-position
Giá trị hợp lệ
startend

experimentalTernariesExperimental Ternaries

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

Mặc định
false
Cờ CLI
--experimental-ternaries

jsxSingleQuoteJsx Single Quote

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

Mặc định
false
Cờ CLI
--jsx-single-quote

quotePropsQuote Props

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

Mặc định
"as-needed"
Cờ CLI
--quote-props
Giá trị hợp lệ
as-neededconsistentpreserve

semiSemi

semicolons, and the ASI hazards behind the default

Mặc định
true
Cờ CLI
--no-semi

trailingCommaTrailing Comma

the option that exists to make diffs smaller

Mặc định
"all"
Cờ CLI
--trailing-comma
Giá trị hợp lệ
alles5none

checkIgnorePragmaCheck Ignore Pragma

lets a file opt itself out of formatting entirely

Mặc định
false
Cờ CLI
--check-ignore-pragma

cursorOffsetCursor Offset

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

Mặc định
-1
Cờ CLI
--cursor-offset

insertPragmaInsert Pragma

stamps a @format marker on every file Prettier formats

Mặc định
false
Cờ CLI
--insert-pragma

rangeEndRange End

the exclusive end of a partial format

Mặc định
Cờ CLI
--range-end

rangeStartRange Start

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

Mặc định
0
Cờ CLI
--range-start

requirePragmaRequire Pragma

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

Mặc định
false
Cờ CLI
--require-pragma