mainValidity
Enforces that the
mainproperty is valid.
✅ This rule is included in the package-json logical presets.
This rule checks that the main property is a non-empty string.
Examples
Section titled “Examples”{ "main": ["index.js", "secondary.js"]}{ "main": "index.js"}When Not To Use It
Section titled “When Not To Use It”If you don’t need compliance with npm’s main 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”- mainPresence - Enforces that the
mainproperty is present.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- ESLint:
package-json/valid-main
Made with ❤️🔥 around the world by
the Flint team and contributors.