Gerador de configuração e playground do Prettier

Carregando Prettier latest…

Referência de opções do Prettier

Todas as opções abaixo estão disponíveis no gerador acima. Os padrões exibidos são do Prettier 3.9.6.

bracketSameLineBracket Same Line

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

Padrão
false
Flag da CLI
--bracket-same-line

bracketSpacingBracket Spacing

the spaces inside object braces, and everywhere they follow

Padrão
true
Flag da CLI
--no-bracket-spacing

objectWrapObject Wrap

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

Padrão
"preserve"
Flag da CLI
--object-wrap
Valores permitidos
preservecollapse

proseWrapProse Wrap

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

Padrão
"preserve"
Flag da CLI
--prose-wrap
Valores permitidos
alwaysneverpreserve

singleAttributePerLineSingle Attribute Per Line

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

Padrão
false
Flag da CLI
--single-attribute-per-line

singleQuoteSingle Quote

a preference Prettier overrides whenever escaping would suffer

Padrão
false
Flag da CLI
--single-quote

embeddedLanguageFormattingEmbedded Language Formatting

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

Padrão
"auto"
Flag da CLI
--embedded-language-formatting
Valores permitidos
autooff

endOfLineEnd Of Line

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

Padrão
"lf"
Flag da CLI
--end-of-line
Valores permitidos
lfcrlfcrauto

printWidthPrint Width

the width Prettier aims for, not a hard limit

Padrão
80
Flag da CLI
--print-width

tabWidthTab Width

how wide one indentation level is, in columns

Padrão
2
Flag da CLI
--tab-width

useTabsUse Tabs

tabs for indentation, and why accessibility is the strongest argument

Padrão
false
Flag da CLI
--use-tabs

htmlWhitespaceSensitivityHtml Whitespace Sensitivity

the option that stops Prettier changing how your page renders

Padrão
"css"
Flag da CLI
--html-whitespace-sensitivity
Valores permitidos
cssstrictignore

vueIndentScriptAndStyleVue Indent Script And Style

whether a Vue SFC indents inside its script and style blocks

Padrão
false
Flag da CLI
--vue-indent-script-and-style

arrowParensArrow Parens

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

Padrão
"always"
Flag da CLI
--arrow-parens
Valores permitidos
alwaysavoid

experimentalOperatorPositionExperimental Operator Position

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

Padrão
"end"
Flag da CLI
--experimental-operator-position
Valores permitidos
startend

experimentalTernariesExperimental Ternaries

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

Padrão
false
Flag da CLI
--experimental-ternaries

jsxSingleQuoteJsx Single Quote

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

Padrão
false
Flag da CLI
--jsx-single-quote

quotePropsQuote Props

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

Padrão
"as-needed"
Flag da CLI
--quote-props
Valores permitidos
as-neededconsistentpreserve

semiSemi

semicolons, and the ASI hazards behind the default

Padrão
true
Flag da CLI
--no-semi

trailingCommaTrailing Comma

the option that exists to make diffs smaller

Padrão
"all"
Flag da CLI
--trailing-comma
Valores permitidos
alles5none

checkIgnorePragmaCheck Ignore Pragma

lets a file opt itself out of formatting entirely

Padrão
false
Flag da CLI
--check-ignore-pragma

cursorOffsetCursor Offset

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

Padrão
-1
Flag da CLI
--cursor-offset

insertPragmaInsert Pragma

stamps a @format marker on every file Prettier formats

Padrão
false
Flag da CLI
--insert-pragma

rangeEndRange End

the exclusive end of a partial format

Padrão
Flag da CLI
--range-end

rangeStartRange Start

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

Padrão
0
Flag da CLI
--range-start

requirePragmaRequire Pragma

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

Padrão
false
Flag da CLI
--require-pragma