Skip to content

Commit f9c5cfb

Browse files
aulikhinfengmk2
andauthored
chore: use sortPackageJson instead of experimentalSortPackageJson (#917)
Following #886, Oxfmt has a configuration option called experimentalSortPackageJson that allows users to specify the order of keys in their package.json files. However, this option is now deprecated and has been [replaced with sortPackageJson](https://oxc.rs/docs/guide/usage/formatter/config.html#configuration-file-format). Co-authored-by: MK (fengmk2) <fengmk2@gmail.com>
1 parent 1b2ba3b commit f9c5cfb

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

docs/config/fmt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default defineConfig({
1212
ignorePatterns: ['dist/**'],
1313
singleQuote: true,
1414
semi: true,
15-
experimentalSortPackageJson: true,
15+
sortPackageJson: true,
1616
},
1717
});
1818
```

packages/cli/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ async function updateCliPackageJson(pkgPath: string, generatedExports: Record<st
719719
}
720720

721721
const { code, errors } = await format(pkgPath, JSON.stringify(pkg, null, 2) + '\n', {
722-
experimentalSortPackageJson: true,
722+
sortPackageJson: true,
723723
});
724724
if (errors.length > 0) {
725725
for (const error of errors) {

packages/core/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ async function mergePackageJson() {
655655
};
656656

657657
const { code, errors } = await format(destPkgPath, JSON.stringify(destPkg, null, 2) + '\n', {
658-
experimentalSortPackageJson: true,
658+
sortPackageJson: true,
659659
});
660660
if (errors.length > 0) {
661661
for (const error of errors) {

vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default defineConfig({
8080
],
8181
singleQuote: true,
8282
semi: true,
83-
experimentalSortPackageJson: true,
83+
sortPackageJson: true,
8484
sortImports: {
8585
groups: [
8686
['type-import'],

0 commit comments

Comments
 (0)