Support configuration files with UTF-8 BOM (#20127)

This commit is contained in:
fisker Cheung authored and GitHub committed 2026-09-22 00:42:47 +08:00
1 parent 6bc99db278
commit 1a36a7defd
5 files changed
+79 -10

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
#### Support configuration files with UTF-8 BOM (#20127 by @fisker)
<!-- prettier-ignore -->
```console
# Input
$ cat .prettierrc.json
{"semi":false}
$ prettier example.js --check
# Prettier stable
Invalid configuration for file "example.js":
JSON Error in .prettierrc.json:
Unexpected token "" (\u{feff})
# Prettier main
Checking formatting...
[warn] example.js
[warn] Code style issues found in the above file. Run Prettier with --write to fix.
```