browserValidity
Enforces that the
browserproperty is valid.
✅ This rule is included in the package-json logical presets.
This rule checks that the browser property is a non-empty string.
The value should be the path to the module used when the package is bundled for browsers.
Examples
Section titled “Examples”{ "browser": ""}{ "browser": {}}{ "browser": "./browser.js"}When Not To Use It
Section titled “When Not To Use It”If you don’t need compliance with npm’s browser field specification, you can disable this rule.
For example, if your package’s browser entry point is interpreted by tooling that accepts a different shape, this rule may not be correct for you.
Related Rules
Section titled “Related Rules”- browserPresence - Enforces that the
browserproperty is present.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- ESLint:
package-json/valid-browser
Made with ❤️🔥 around the world by
the Flint team and contributors.