If sortPackageJson is enabled this code
{
"exports": {
"./": {
"@scope/source": "./src/index.ts",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
}
is formatted to
{
"exports": {
"./": {
"types": "./dist/index.d.ts",
"@scope/source": "./src/index.ts",
"default": "./dist/index.js"
}
}
}
Setting the types key first in the conditional imports/exports section breaks typescript monorepos that use typescript custom conditions (example @scope/source like suggested by https://colinhacks.com/essays/live-types-typescript-monorepo at point 5)
see: keithamus/sort-package-json#393 in the original sort-package-json for additional informations
this behaviour should be removed (a formatter should not alter the behaviour of code) or at least it should be possible to disable
If
sortPackageJsonis enabled this code{ "exports": { "./": { "@scope/source": "./src/index.ts", "types": "./dist/index.d.ts", "default": "./dist/index.js" } } }is formatted to
{ "exports": { "./": { "types": "./dist/index.d.ts", "@scope/source": "./src/index.ts", "default": "./dist/index.js" } } }Setting the
typeskey first in the conditional imports/exports section breaks typescript monorepos that use typescript custom conditions (example@scope/sourcelike suggested by https://colinhacks.com/essays/live-types-typescript-monorepo at point 5)see: keithamus/sort-package-json#393 in the original sort-package-json for additional informations
this behaviour should be removed (a formatter should not alter the behaviour of code) or at least it should be possible to disable