JoshuaKGoldberg / package.json-validator

Tools to validate package.json files
MIT License
107 stars 26 forks source link

Drop support for licenses (plural) and change support for license to be a supported string #40

Closed pdehaan closed 5 months ago

pdehaan commented 9 years ago

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

jasonkarns commented 9 years 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.

JoshuaKGoldberg commented 5 months ago

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! 🧡