I ran into this error while using a .prettierrc.json file, and the problem was that the file was encoded in UTF-16LE, not UTF-8. Saving the file as UTF-8 fixed this for me.

The root cause of this issue was following the documentation that recommended echo {}> .prettierrc.json to create the file. On Windows powershell, this creates a UTF-16LE file, not a UTF-8 file.

More discussion can be found at this github issue

Answer from Luke Miller on Stack Overflow
🌐
Prettier
prettier.io › docs › cli
CLI · Prettier
Use the prettier command to run Prettier from the command line.
🌐
GitHub
github.com › prettier › prettier-cli
GitHub - prettier/prettier-cli: A faster CLI for Prettier.
A faster CLI for Prettier. Contribute to prettier/prettier-cli development by creating an account on GitHub.
Starred by 40 users
Forked by 10 users
Languages   JavaScript 50.9% | TypeScript 48.9%
🌐
Prettier
prettier.io › blog › 2023 › 11 › 30 › cli-deep-dive
Prettier's CLI: A Performance Deep Dive · Prettier
November 30, 2023 - Hey, I'm Fabio and I've been contracted by the Prettier team to speed up Prettier's command line interface (CLI). In this post we'll take a look at the optimizations I've discovered, the process that lead to finding them, some exciting numbers comparing the current CLI with the new one, and ...
🌐
GitHub
github.com › prettier › prettier › issues › 7073
A better Prettier CLI and config file · Issue #7073 · prettier/prettier
November 30, 2019 - If a PATH points to a file, that file is formatted. If the file is ignored a note about that is printed. (We could have a --force flag to override.) If the file type isn’t something that Prettier handles, an error is printed.
Published   Nov 30, 2019
🌐
Michael Currin
michaelcurrin.github.io › dev-cheatsheets › cheatsheets › javascript › format-and-lint › prettier › cli.html
CLI | Dev Cheatsheets
Usage: prettier [options] [file/dir/glob ...] By default, output is written to stdout. Stdin is read if it is piped to Prettier and no files are given. Output options: -c, --check Check if the given files are formatted, print a human-friendly summary message and paths to unformatted files (see ...
🌐
npm
npmjs.com › package › @prettier › cli
prettier/cli
A faster CLI for Prettier.. Latest version: 0.10.0, last published: 3 months ago. Start using @prettier/cli in your project by running `npm i @prettier/cli`. There are no other projects in the npm registry using @prettier/cli.
      » npm install @prettier/cli
    
Published   Nov 17, 2025
Version   0.10.0
Find elsewhere
🌐
GitHub
github.com › prettier › prettier-eslint-cli
GitHub - prettier/prettier-eslint-cli: CLI for prettier-eslint · GitHub
This will format all .js files in the src directory. The argument you pass to the CLI is a glob and you can pass as many as you wish. You can also pass options. ... This makes prettier-eslint-cli power the gq command for automatic formatting without any plugins.
Author   prettier
🌐
Fishtank
getfishtank.com › insights › running-prettier-from-the-command-line
Running Prettier from the Command Line | Fishtank
Prettier have helped to speed up code writing where an individual does not have to worry about code formatting which used to be a developer’s nightmare, it is customizable, runs offline and is completely free. It boosts up developer’s accuracy level, knowing that Prettier got you!
🌐
Prettier
prettier.io › docs › install
Install · Prettier
Next, create a .prettierignore file to let the Prettier CLI and editors know which files to not format.
🌐
npm
npmjs.com › package › prettier-eslint-cli
prettier-eslint-cli - npm
CLI for prettier-eslint. Latest version: 8.0.1, last published: 2 years ago. Start using prettier-eslint-cli in your project by running `npm i prettier-eslint-cli`. There are 164 other projects in the npm registry using prettier-eslint-cli.
      » npm install prettier-eslint-cli
    
Published   Oct 14, 2023
Version   8.0.1
Author   Kent C. Dodds
🌐
E18e
e18e.dev › blog › prettier-speed-up.html
Improving Prettier performance with the new CLI | e18e
Today, I'm happy to announce that it is now available behind a flag in the latest version of Prettier! ... # via the CLI flag prettier . --check --experimental-cli # via an environment variable PRETTIER_EXPERIMENTAL_CLI=1 prettier .
🌐
Fig
fig.io › manual › prettier
prettier [file, dir or glob...] | Fig
Run Prettier from the command line · Made with ❤️ in San Francisco Copyright © 2026 Hercules Labs Inc
🌐
GitHub
github.com › prettier › prettier › issues › 6280
How do I use the CLI to fix all files? · Issue #6280 · prettier/prettier
July 9, 2019 - If I try prettier --check "*" or prettier --check NOTHING then Prettier seems to completely ignore the .prettierignore file. The option --config-precedence=file-override looks like a solution. It supposedly makes the config file take precedence over the CLI.
Published   Jul 09, 2019
🌐
Prettier
prettier.io › blog › 2025 › 06 › 23 › 3.6.0
Prettier 3.6: Experimental fast CLI and new OXC and Hermes plugins! · Prettier
June 23, 2025 - First, we're shipping a new experimental high-performance CLI behind a feature flag (--experimental-cli). This CLI was previously only available in prettier@next, but now you can enable it simply by using a flag. We encourage you to try it out and share your feedback!
🌐
npm
npmjs.com › package › prettier
prettier - npm
Prettier is an opinionated code formatter. Latest version: 3.8.1, last published: 2 months ago. Start using prettier in your project by running `npm i prettier`. There are 20158 other projects in the npm registry using prettier.
      » npm install prettier
    
Published   Jan 21, 2026
Version   3.8.1
Author   James Long
🌐
Prettier
prettier.io › docs › plugins
Plugins · Prettier
The core prettier package contains JavaScript and other web-focused languages built in. For additional languages you’ll need to install a plugin. You can load plugins with: The CLI, via --plugin: prettier --write main.foo --plugin=prettie...
🌐
Svelte
svelte.dev › docs › cli › prettier
prettier • Svelte CLI Docs
CLIAdd-ons · Prettier is an opinionated code formatter. npx sv add prettier · scripts in your package.json · .prettierignore and .prettierrc files · updates to your eslint config if you're using that package · Edit this page on GitHub llms.txt · previous next ·
🌐
Oxidation Compiler
oxc.rs › docs › guide › usage › formatter.html
Oxfmt
Oxfmt integrates into existing Prettier-based workflows. The oxfmt CLI behaves similarly to Prettier by default, allowing adoption with minimal changes to scripts and tooling.