سازندهٔ پیکربندی و زمین بازی 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

a preference Prettier overrides whenever escaping would suffer

پیش‌فرض
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

the width Prettier aims for, not a hard limit

پیش‌فرض
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

semicolons, and the ASI hazards behind the default

پیش‌فرض
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