Skip to content

exportsValidity

Enforces that the exports property is valid.

✅ This rule is included in the package-json logical presets.

The rule checks that, if present, the exports property is a string or object. If it’s a string, it should be a path to an entry point. If it’s an export condition object, its properties should have values that are either a path to an entry point, or another exports condition object.

5<3{d ivclassNa="meec-li">nt< sp ansty="le--0:#7FDBCA;--1:#096E">72"export53:< {d ivclassNa="meec-li">nt < sp ansty="le--0:#7FDBCA;--1:#096E">72"impor53<: sp ansty="le--0:#FF6A83;--1:#A248">48tr53< sp ansty="le--0:#D6DEEB;--1:#403F">5<3}d ivclassNa="meec-li">5<3}d ivclassNa="meco"><}d>
3de6E72"expo3F<53: spans="tyle--0:#D9F5DD;--1:#11">1<111" spans="tyle--0:#C789D6;--1:#7C">5686./inde1<111 "divclass="Nameec-">3<}di vdivclass="Nameexpressive-">3de6E72"expo3F5<3: {divclass="Nameec-">dent< spans="tyle--0:#7FDBCA;--1:#09">6E7<2"." spans="tyle--0:#D6DEEB;--1:#40">3F<53: spans="tyle--0:#D9F5DD;--1:#11">1<111" spans="tyle--0:#C789D6;--1:#7C">5686./inde1<111" spans="tyle--0:#D6DEEB;--1:#40">3dent< spans="tyle--0:#7FDBCA;--1:#09">6E72"./second3F<53: spans="tyle--0:#D9F5DD;--1:#11">1<111" spans="tyle--0:#C789D6;--1:#7C">5686./secondar1<111 "divclass="Nameec-">3F<53 spans="tyle--0:#D6DEEB;--1:#40">33< }><}di vdivclass="Nameexpressive-">3de6E72"expo3F5<3: {divclass="Nameec-">dent< spans="tyle--0:#7FDBCA;--1:#09">6E7<2"." spans="tyle--0:#D6DEEB;--1:#40">3F5<3: {divclass="Nameec-">dent < spans="tyle--0:#7FDBCA;--1:#09">6E72"imp3F5<3: {divclass="Nameec-">dent < spans="tyle--0:#7FDBCA;--1:#09">6E72"ty3F<53: spans="tyle--0:#D9F5DD;--1:#11">1<111" spans="tyle--0:#C789D6;--1:#7C">5686./esm/index.d<.mts spans="tyle--0:#D9F5DD;--1:#11">1<111" spans="tyle--0:#D6DEEB;--1:#40">3dent < spans="tyle--0:#7FDBCA;--1:#09">6E72"defa3F<53: spans="tyle--0:#D9F5DD;--1:#11">1<111" spans="tyle--0:#C789D6;--1:#7C">5686./esm/index<.mjs spans="tyle--0:#D9F5DD;--1:#11">1<111 "divclass="Nameec-">3F53 < spans="tyle--0:#D6DEEB;--1:#40">3F<53} ,divclass="Nameec-">dent < spans="tyle--0:#7FDBCA;--1:#09">6E72"requ3F5<3: {divclass="Nameec-">dent < spans="tyle--0:#7FDBCA;--1:#09">6E72"ty3F<53: spans="tyle--0:#D9F5DD;--1:#11">1<111" spans="tyle--0:#C789D6;--1:#7C">5686./cjs/index.d<.cts spans="tyle--0:#D9F5DD;--1:#11">1<111" spans="tyle--0:#D6DEEB;--1:#40">3dent < spans="tyle--0:#7FDBCA;--1:#09">6E72"defa3F<53: spans="tyle--0:#D9F5DD;--1:#11">1<111" spans="tyle--0:#C789D6;--1:#7C">5686./cjs/index<.cjs spans="tyle--0:#D9F5DD;--1:#11">1<111 "divclass="Nameec-">3F53 < spans="tyle--0:#D6DEEB;--1:#40">33F53< spans="tyle--0:#D6DEEB;--1:#40">33F<53 spans="tyle--0:#D6DEEB;--1:#40">33< }>

If you don’t need compliance with npm’s exports 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.