Home

prettierrc

Prettierrc refers to the configuration files used by Prettier, a widely adopted code formatter that enforces a consistent style across a project. The prettierrc file stores preferences that influence how source code is formatted, including line length, quote style, and spacing. By configuring Prettier, teams can ensure uniform formatting regardless of individual editors or IDEs.

A configuration can take several forms. Common names include .prettierrc, .prettierrc.json, .prettierrc.yaml or .prettierrc.yml, .prettierrc.js, or

The configuration is a JSON-like object of options. Widely used settings include printWidth (line length), tabWidth,

If no prettierrc is found, Prettier falls back to its default options. Editor integrations, build scripts, and

prettier.config.js.
A
project
may
also
place
a
"prettier"
key
in
package.json.
Prettier
supports
JSON,
YAML,
and
JavaScript/JavaScript-like
module
exports
for
configuration.
It
will
locate
the
configuration
by
walking
up
from
the
file
being
formatted,
stopping
at
the
project
root
or
a
global
config.
useTabs,
semi,
singleQuote,
trailingComma,
endOfLine,
bracketSpacing,
jsxBracketSameLine,
and
arrowParens.
Other
options
cover
quoteProps,
proseWrap,
requirePragma,
and
insertPragma.
An
overrides
array
lets
you
apply
different
rules
to
specific
file
patterns,
and
an
ignorePath
or
.prettierignore
file
can
exclude
files
from
formatting.
CI
pipelines
can
read
these
configuration
files
to
ensure
consistent
formatting
across
development
environments.