Generator konfiguracji i playground Prettier

Ładowanie Prettier latest…

Dokumentacja opcji Prettier

Każda opcja poniżej jest dostępna w generatorze powyżej. Pokazane wartości domyślne pochodzą z Prettier 3.9.6.

bracketSameLineBracket Same Line

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

Domyślnie
false
Flaga CLI
--bracket-same-line

bracketSpacingBracket Spacing

the spaces inside object braces, and everywhere they follow

Domyślnie
true
Flaga CLI
--no-bracket-spacing

objectWrapObject Wrap

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

Domyślnie
"preserve"
Flaga CLI
--object-wrap
Dozwolone wartości
preservecollapse

proseWrapProse Wrap

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

Domyślnie
"preserve"
Flaga CLI
--prose-wrap
Dozwolone wartości
alwaysneverpreserve

singleAttributePerLineSingle Attribute Per Line

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

Domyślnie
false
Flaga CLI
--single-attribute-per-line

singleQuoteSingle Quote

a preference Prettier overrides whenever escaping would suffer

Domyślnie
false
Flaga CLI
--single-quote

embeddedLanguageFormattingEmbedded Language Formatting

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

Domyślnie
"auto"
Flaga CLI
--embedded-language-formatting
Dozwolone wartości
autooff

endOfLineEnd Of Line

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

Domyślnie
"lf"
Flaga CLI
--end-of-line
Dozwolone wartości
lfcrlfcrauto

printWidthPrint Width

the width Prettier aims for, not a hard limit

Domyślnie
80
Flaga CLI
--print-width

tabWidthTab Width

how wide one indentation level is, in columns

Domyślnie
2
Flaga CLI
--tab-width

useTabsUse Tabs

tabs for indentation, and why accessibility is the strongest argument

Domyślnie
false
Flaga CLI
--use-tabs

htmlWhitespaceSensitivityHtml Whitespace Sensitivity

the option that stops Prettier changing how your page renders

Domyślnie
"css"
Flaga CLI
--html-whitespace-sensitivity
Dozwolone wartości
cssstrictignore

vueIndentScriptAndStyleVue Indent Script And Style

whether a Vue SFC indents inside its script and style blocks

Domyślnie
false
Flaga CLI
--vue-indent-script-and-style

arrowParensArrow Parens

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

Domyślnie
"always"
Flaga CLI
--arrow-parens
Dozwolone wartości
alwaysavoid

experimentalOperatorPositionExperimental Operator Position

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

Domyślnie
"end"
Flaga CLI
--experimental-operator-position
Dozwolone wartości
startend

experimentalTernariesExperimental Ternaries

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

Domyślnie
false
Flaga CLI
--experimental-ternaries

jsxSingleQuoteJsx Single Quote

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

Domyślnie
false
Flaga CLI
--jsx-single-quote

quotePropsQuote Props

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

Domyślnie
"as-needed"
Flaga CLI
--quote-props
Dozwolone wartości
as-neededconsistentpreserve

semiSemi

semicolons, and the ASI hazards behind the default

Domyślnie
true
Flaga CLI
--no-semi

trailingCommaTrailing Comma

the option that exists to make diffs smaller

Domyślnie
"all"
Flaga CLI
--trailing-comma
Dozwolone wartości
alles5none

checkIgnorePragmaCheck Ignore Pragma

lets a file opt itself out of formatting entirely

Domyślnie
false
Flaga CLI
--check-ignore-pragma

cursorOffsetCursor Offset

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

Domyślnie
-1
Flaga CLI
--cursor-offset

insertPragmaInsert Pragma

stamps a @format marker on every file Prettier formats

Domyślnie
false
Flaga CLI
--insert-pragma

rangeEndRange End

the exclusive end of a partial format

Domyślnie
Flaga CLI
--range-end

rangeStartRange Start

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

Domyślnie
0
Flaga CLI
--range-start

requirePragmaRequire Pragma

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

Domyślnie
false
Flaga CLI
--require-pragma