Is there an existing issue for this?
Current Behavior
Given the following package.json:
{
"name": "spj-te",
"dependencies": {
"sort-package-json": "^1.52.0"
},
"devDependencies": {
"@types/koa-bodyparser": "^4.3.3",
"@types/koa__router": "^8.0.8"
}
}
Running:
npm install sort-package-json
Gives:
{
"name": "spj-te",
"dependencies": {
"sort-package-json": "^1.52.0"
},
"devDependencies": {
"@types/koa__router": "^8.0.8",
"@types/koa-bodyparser": "^4.3.3"
}
}
Expected Behavior
I'd expect the package.json not to have changed.
This expected sort ordering is what appears to currently be used by:
- npm v6
- yarn v1 & v2
- pnpm v6
sort-package-json
Obviously this is a cosmetic bug and (afaik) there isn't a defined standard on the order that should be used in the ecosystem, but given it looks like just npm v7/8 is the odd duck I figured I'd open an issue to see if folks would be open to a PR, as it makes for noisy diffs to have packages swap back and forward 😅
I'm happy to help do the work - I suspect based on #1766 it could be a matter of adjusting the code added in this commit having looked a bit more into this, it looks like this commits function has gone away so would appreciate being pointed in the right direction
Steps To Reproduce
See Current Behaviour
Environment
- OS: Ubuntu 18.04
- Node: 16.0.0
- npm: v8 (latest, via
npx), and v7 (latest, via npx)
Is there an existing issue for this?
Current Behavior
Given the following
package.json:Running:
Gives:
Expected Behavior
I'd expect the
package.jsonnot to have changed.This expected sort ordering is what appears to currently be used by:
sort-package-jsonObviously this is a cosmetic bug and (afaik) there isn't a defined standard on the order that should be used in the ecosystem, but given it looks like just npm v7/8 is the odd duck I figured I'd open an issue to see if folks would be open to a PR, as it makes for noisy diffs to have packages swap back and forward 😅
I'm happy to help do the work -
I suspect based on #1766 it could be a matter of adjusting the code added in this commithaving looked a bit more into this, it looks like this commits function has gone away so would appreciate being pointed in the right directionSteps To Reproduce
See Current Behaviour
Environment
npx), and v7 (latest, vianpx)