Generador de configuración y playground de Prettier

Cargando Prettier latest…

Referencia de opciones de Prettier

Todas las opciones siguientes están disponibles en el generador de arriba. Los valores por defecto son los de Prettier 3.9.6.

bracketSameLineBracket Same Line

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

Por defecto
false
Opción CLI
--bracket-same-line

bracketSpacingBracket Spacing

the spaces inside object braces, and everywhere they follow

Por defecto
true
Opción CLI
--no-bracket-spacing

objectWrapObject Wrap

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

Por defecto
"preserve"
Opción CLI
--object-wrap
Valores permitidos
preservecollapse

proseWrapProse Wrap

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

Por defecto
"preserve"
Opción CLI
--prose-wrap
Valores permitidos
alwaysneverpreserve

singleAttributePerLineSingle Attribute Per Line

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

Por defecto
false
Opción CLI
--single-attribute-per-line

singleQuoteSingle Quote

a preference Prettier overrides whenever escaping would suffer

Por defecto
false
Opción CLI
--single-quote

embeddedLanguageFormattingEmbedded Language Formatting

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

Por defecto
"auto"
Opción CLI
--embedded-language-formatting
Valores permitidos
autooff

endOfLineEnd Of Line

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

Por defecto
"lf"
Opción CLI
--end-of-line
Valores permitidos
lfcrlfcrauto

printWidthPrint Width

the width Prettier aims for, not a hard limit

Por defecto
80
Opción CLI
--print-width

tabWidthTab Width

how wide one indentation level is, in columns

Por defecto
2
Opción CLI
--tab-width

useTabsUse Tabs

tabs for indentation, and why accessibility is the strongest argument

Por defecto
false
Opción CLI
--use-tabs

htmlWhitespaceSensitivityHtml Whitespace Sensitivity

the option that stops Prettier changing how your page renders

Por defecto
"css"
Opción CLI
--html-whitespace-sensitivity
Valores permitidos
cssstrictignore

vueIndentScriptAndStyleVue Indent Script And Style

whether a Vue SFC indents inside its script and style blocks

Por defecto
false
Opción CLI
--vue-indent-script-and-style

arrowParensArrow Parens

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

Por defecto
"always"
Opción CLI
--arrow-parens
Valores permitidos
alwaysavoid

experimentalOperatorPositionExperimental Operator Position

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

Por defecto
"end"
Opción CLI
--experimental-operator-position
Valores permitidos
startend

experimentalTernariesExperimental Ternaries

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

Por defecto
false
Opción CLI
--experimental-ternaries

jsxSingleQuoteJsx Single Quote

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

Por defecto
false
Opción CLI
--jsx-single-quote

quotePropsQuote Props

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

Por defecto
"as-needed"
Opción CLI
--quote-props
Valores permitidos
as-neededconsistentpreserve

semiSemi

semicolons, and the ASI hazards behind the default

Por defecto
true
Opción CLI
--no-semi

trailingCommaTrailing Comma

the option that exists to make diffs smaller

Por defecto
"all"
Opción CLI
--trailing-comma
Valores permitidos
alles5none

checkIgnorePragmaCheck Ignore Pragma

lets a file opt itself out of formatting entirely

Por defecto
false
Opción CLI
--check-ignore-pragma

cursorOffsetCursor Offset

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

Por defecto
-1
Opción CLI
--cursor-offset

insertPragmaInsert Pragma

stamps a @format marker on every file Prettier formats

Por defecto
false
Opción CLI
--insert-pragma

rangeEndRange End

the exclusive end of a partial format

Por defecto
Opción CLI
--range-end

rangeStartRange Start

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

Por defecto
0
Opción CLI
--range-start

requirePragmaRequire Pragma

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

Por defecto
false
Opción CLI
--require-pragma