WindowsmacOSLinux

Where Does Prettier Store Its Config?

Prettier reads .prettierrc or the prettier key in package.json, searching upward with no global config allowed.

Last updated

Prettier resolves config per file, searching upward from the formatted file through .prettierrc variants, prettier.config.js, or the prettier key in package.json. The first hit wins, which lets monorepo packages diverge cleanly.

There is intentionally no home directory fallback. If formatting differs between machines, someone has two configs in the ancestry or no committed config at all, not a hidden global.

Where Prettier stores this, by platform

Windows
[RepoDir]\.prettierrc.json

Usual home: .prettierrc.json, prettier.config.js, or the prettier key in package.json. Search starts at the formatted file and walks up; .prettierignore trims what gets touched.

macOS
[RepoDir]/.prettierrc.json

Same discovery. An empty .prettierrc ({}) just signals editors the project uses Prettier; real options live in whatever file the search finds first.

Linux
[RepoDir]/.prettierrc.json

Same layout. Pin an exact Prettier version too: even patch releases can reformat lines, so teammates on different versions fight each other through the config.

Frequently asked questions

Where is Prettier's global config file?

You cannot. Prettier deliberately supports no global config so a cloned repo formats identically everywhere. Editor defaults and .editorconfig fill the gap instead.

I have both .editorconfig and .prettierrc. Which wins?

Both apply, with .prettierrc winning. Prettier also absorbs matching .editorconfig properties (indent, newlines, width) underneath your explicit settings.

Notice an outdated path? Let us know.