nameValidity
Enforces that the
nameproperty is valid.
✅ This rule is included in the package-json logical presets.
This rule ensures that the name field is a string matching the npm specification:
- It must be a string rather than any other data type
- It should pass
validate-npm-package-namevalidation
Examples
Section titled “Examples”{ "name": ""}{ "name": null}{ "name": "Invalid Name"}{ "name": "my-repository"}{ "name": "@scoped/my-repository"}When Not To Use It
Section titled “When Not To Use It”If you don’t need compliance with npm’s name 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”- namePresence - Enforces that the
nameproperty is present.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- ESLint:
package-json/valid-name
Made with ❤️🔥 around the world by
the Flint team and contributors.