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