Allow customizing useSortedPackageJson exports order #11298
ysulyma
started this conversation in
Rule suggestion
Replies: 1 comment
|
For us, we do not like to sort the scripts, because we have them sorted in groups with. (due to the lack of comments support) E.g. {
"scripts": {
"prepare": "husky || true",
"clean": "",
"----- Development -----": "-----",
"predev": "",
"dev": "",
"build": "",
"test": "",
"test:update": "",
"generate-graphql": "",
"----- Lint & Format -----": "-----",
"format-n-lint": "",
"format-n-lint:fix": "",
"format-n-lint:ci": "",
"check-types": "",
"knip": "knip",
"----- CI -----": "-----",
"build:ci": "",
"----- Create -----": "-----",
"create": "",
"----- Commit -----": "-----",
"change": "changeset",
"change:empty": "changeset --empty",
"commit": "",
"----- Version Check -----": "-----",
"version:check": "",
"version:report": "",
"version:summary": "",
}
} |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
My
package.jsonexports field looks like this:but
useSortedPackageJsonrewrites it toThis order is officially recommended (see Node docs below). However, I want to have the custom condition
@liqvid/devfirst so that I get proper types without having to re-runtsc(this is in a monorepo with ~50 packages).To make matters worse, I often change
@liqvid/devtodefault(still keeping it first) because Turbopack doesn't yet support custom conditions. So special-casing non-standard conditions won't work, I need to be able to specify the orderdefault,types,import.I could also live with just disabling the sorting of
exports, since I already have a script that toggles between@liqvid/dev<->defaultand enforces the correct order, it's just annoying that it's incompatible with the Biome rule.Node docs - Custom Conditions
TypeScript docs - Custom Conditions
All reactions