JoshuaKGoldberg / package.json-validator

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

🚀 Feature: Recommend "type" #68

Open brettz9 opened 4 years ago

brettz9 commented 4 years ago

Per https://nodejs.org/api/esm.html#esm_package_json_type_field

Package authors should include the "type" field, even in packages where all sources are CommonJS. Being explicit about the type of the package will future-proof the package in case the default type of Node.js ever changes, and it will also make things easier for build tools and loaders to determine how the files in the package should be interpreted.

It could also be checked for the valid values "commonjs" or "module".

Thanks!