osValidity
Enforces that the
osproperty is valid.
✅ This rule is included in the package-json logical presets.
This rule checks that the os property is an array where all items are valid OS values: “aix”, “android”, “darwin”, “freebsd”, “linux”, “openbsd”, “sunos”, and “win32”.
These values are the list of possible process.platform values documented by Node.
Examples
Section titled “Examples”{ "os": ["x64"]}{ "os": ["linux", "win32"]}When Not To Use It
Section titled “When Not To Use It”If you don’t need compliance with npm’s osValidity 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”- osPresence - Enforces that the
osproperty is present.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- ESLint:
package-json/valid-os
Made with ❤️🔥 around the world by
the Flint team and contributors.