Closed pdehaan closed 5 months ago
My suggestion would be that missing both license
and licenses
should result in a warning and recommend license
. But if licenses
is present, it should emit a recommendation to switch to license
.
Similar to https://github.com/TechNickAI/package.json-validator/issues/26#issuecomment-2025011574, looks like license
(singular) has since been given support, so I'm going to go ahead and close this out as resolved. From https://docs.npmjs.com/cli/v10/configuring-npm/package-json#license:
If your package is licensed under multiple common licenses, use an SPDX license expression syntax version 2.0 string, like this:
{ "license": "(ISC OR GPL-3.0)" }
Some old packages used license objects or a "licenses" property containing an array of license objects ... Those styles are now deprecated.
Cheers! 🧡
There are a few new
license
changes in newer versions of npm.https://docs.npmjs.com/files/package.json#license http://npm1k.org/
For valid license strings, see https://www.npmjs.com/package/spdx