typeValidity
Enforces that the
typeproperty is valid.
✅ This rule is included in the package-json logical presets.
This rule checks that the type property is a string with a value of either commonjs or module.
Examples
Section titled “Examples”{ "type": "esm"}{ "type": "module"}When Not To Use It
Section titled “When Not To Use It”If you don’t need compliance with npm’s type 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”- typePresence - Enforces that the
typeproperty is present.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- ESLint:
package-json/valid-type
Made with ❤️🔥 around the world by
the Flint team and contributors.