binValidity
Enforces that the
binproperty is valid.
✅ This rule is included in the package-json logical presets.
This rule checks that the bin property is either a non-empty string or an object.
If the value is an object, it should only consist of non-empty string values.
Examples
Section titled “Examples”{ "bin": { "invalid-bin": 123 }}{ "bin": "./bin/cli.js"}{ "bin": { "my-cli": "./bin/cli.js" }}When Not To Use It
Section titled “When Not To Use It”If you don’t need compliance with npm’s bin 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”- binPresence - Enforces that the
binproperty is present.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- ESLint:
package-json/valid-bin
Made with ❤️🔥 around the world by
the Flint team and contributors.