Open alissonlauffer opened 1 day ago
It seems that Prettier actually creates a special case for package.json
and expands all JSON lists only there by default. Other JSON files are handled in the same way as Biome currently handles all JSON files (collapsing them unless the line length exceeds the limit):
// bunx prettier package.json
{
"name": "biome-repro",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"format": "biome format .",
"lint": "biome lint",
"check": "biome check",
"ci": "biome ci"
},
"devDependencies": {
"@biomejs/biome": "1.9.3"
},
"anyKey": [
"foo",
"bar"
]
}
// bunx prettier anyother.json
{
"name": "biome-repro",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"format": "biome format .",
"lint": "biome lint",
"check": "biome check",
"ci": "biome ci"
},
"devDependencies": {
"@biomejs/biome": "1.9.3"
},
"anyKey": ["foo", "bar"]
}
Yup. Prettier makes this exception so it's output aligns with what is output from package managers like npm and yarn.
Environment information
Configuration
Playground link
https://github.com/alissonlauffer/biome-repro-1728945668010
Code of Conduct