Skip to content

osValidity

Enforces that the os property 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.

5<3{d ivclassNa="meec-li">nt< sp ansty="le--0:#7FDBCA;--1:#096E">72"o53:< [sp ansty="le--0:#D9F5DD;--1:#1111">1<1"sp ansty="le--0:#C789D6;--1:#7C56">86x<64sp ansty="le--0:#D9F5DD;--1:#1111">1<1"sp ansty="le--0:#D6DEEB;--1:#403F">5<3]d ivclassNa="meec-li">5<3}d ivclassNa="meco"><}d>
3de6E72<"os" spans="tyle--0:#D6DEEB;--1:#40">3F5<3: [ spans="tyle--0:#D9F5DD;--1:#11">1<111" spans="tyle--0:#C789D6;--1:#7C">5686l1<111" spans="tyle--0:#D6DEEB;--1:#40">3F<53, spans="tyle--0:#D9F5DD;--1:#11">1<111" spans="tyle--0:#C789D6;--1:#7C">5686w1<111" spans="tyle--0:#D6DEEB;--1:#40">33<"]>

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.

  • osPresence - Enforces that the os property is present.