package.json-validator
package.json-validator copied to clipboard
🐛 Bug: Support version protocols: npm:, workspace:, etc.
I use the syntax of the title so that I can have two different major version of one project as a dependency (one @1.x.x
and one 2.x.x
), but this validator doesn't recognize this syntax and outputs an error instead. It would be cool if this syntax was supported, but given that it is quite uncommon (to the best of my knowledge) I don't think this should be a priority.
The following package.json
content can be used to reproduce this error.
{
"name": "project",
"version": "1.0.0",
"private": true,
"description": "...",
"homepage": "https://github.com/ericcornelissen/project",
"license": "MIT",
"main": "lib/index.js",
"repository": {
"type": "git",
"url": "https://github.com/ericcornelissen/project"
},
"dependencies": {
"svgo-v1": "npm:[email protected]",
"svgo-v2": "npm:[email protected]"
}
}
This would be great. We have to work around it in https://github.com/JoshuaKGoldberg/eslint-plugin-package-json right now, such as in https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/pull/258. Accepting PRs!
Related: #38, for file:
.