authorValidity
Enforces that the
authorproperty is valid.
✅ This rule is included in the package-json logical presets.
npm requires that the author field in package.json follows certain specifications if it is present.
The field can be either a string or an object with specific properties.
Examples
Section titled “Examples”{ "author": ""}{ "author": null}{ "author": "Name <invalid>"}{ "author": {}}{ "author": { "name": "Name", "email": "invalid" }}{ "author": "First Last"}{ "author": "Name <name@example.com>"}{ "author": { "name": "Name" }}{ "author": { "name": "Name", "email": "name@example.com", "url": "https://example.com" }}When Not To Use It
Section titled “When Not To Use It”If you don’t need compliance with npm’s author field specification, you can disable this rule.
For example, if you use a different package manager that treats the field differently, this rule may not be correct for you.
Related Rules
Section titled “Related Rules”- authorPresence - Enforces that the
authorproperty is present.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- ESLint:
package-json/valid-author
Made with ❤️🔥 around the world by
the Flint team and contributors.