valid-funding
💼 This rule is enabled in the following configs: ✅ recommended, 📦 recommended-publishable.
This rule uses package-json-validator to validate the funding property, if present, against the following criteria:
- The value is an object, a string, or an Array of objects and strings
- If it’s an object, it should have properties
typeandurl typeshould be a non-empty stringurlshould be a valid URL- If it’s a string, it should be a URL.
Examples
Section titled “Examples”{ "funding": { "email": "some@mail.com", "type": "patreon" }}{ "funding": { "type": "patreon", "url": "https://patreon.com/treznor" }}{ "funding": "http://npmjs.com/donate"}{ "funding": [ { "type": "individual", "url": "http://npmjs.com/donate" }, "http://npmjs.com/donate-also", { "type": "patreon", "url": "https://patreon.com/treznor" } ]}Related Rules
Section titled “Related Rules”require-funding- Enforces that thefundingproperty is present.