Генератор конфигурации и песочница 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