Генератор конфігурації та майданчик 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