There was an error while loading. Please reload this page.
1 parent 421d8e2 commit abb28dcCopy full SHA for abb28dc
1 file changed
apps/oxfmt/src/core/format.rs
@@ -228,12 +228,17 @@ impl SourceFormatter {
228
sort_package_json: bool,
229
) -> Result<String, OxcDiagnostic> {
230
let source_text: Cow<'_, str> = if sort_package_json {
231
- Cow::Owned(sort_package_json::sort_package_json(source_text).map_err(|err| {
232
- OxcDiagnostic::error(format!(
233
- "Failed to sort package.json: {}\n{err}",
234
- path.display()
235
- ))
236
- })?)
+ let options = sort_package_json::SortOptions { pretty: false };
+ Cow::Owned(
+ sort_package_json::sort_package_json_with_options(source_text, &options).map_err(
+ |err| {
+ OxcDiagnostic::error(format!(
+ "Failed to sort package.json: {}\n{err}",
237
+ path.display()
238
+ ))
239
+ },
240
+ )?,
241
+ )
242
} else {
243
Cow::Borrowed(source_text)
244
};
0 commit comments