Skip to content

symbolDescriptions

Reports Symbol() calls without description arguments.

✅ This rule is included in the ts stylistic and stylisticStrict presets.

Creating symbols without descriptions makes debugging difficult, as the symbol’s purpose isn’t clear when inspecting it. While the description doesn’t affect the symbol’s uniqueness, it appears in the symbol’s string representation and can be accessed via Symbol.prototype.description. Providing meaningful descriptions helps developers understand the purpose of each symbol during debugging and logging.

AEconsB0uniqueAE <= sp ansty="le--0:#82AAFF;--1:#3B61">B0Symb53(<);d ivclassNa="meec-li">AEconsB0privateKAE <= sp ansty="le--0:#82AAFF;--1:#3B61">B0Symb53(<);d ivclassNa="meec-li">dAEcla5<3 sp ansty="le--0:#FFCB8B;--1:#1111">11MyCla53< {d ivclassNa="meec-li">53< sp ansty="le--0:#D6DEEB;--1:#403F">5<3[sp ansty="le--0:#82AAFF;--1:#3B61">B0Symb53(<)]sp ansty="le--0:#D9F5DD;--1:#1111">11<()sp ansty="le--0:#D6DEEB;--1:#403F">53< {d ivclassNa="meec-li">nt < sp ansty="le--0:#C792EA;--1:#8844">AEretu5<3 sp ansty="le--0:#D9F5DD;--1:#1111">1<1"sp ansty="le--0:#ECC48D;--1:#984E">4Dmeth1<1"sp ansty="le--0:#D6DEEB;--1:#403F">5<3;d ivclassNa="meec-li">53< sp ansty="le--0:#D6DEEB;--1:#403F">5<3}d ivclassNa="meec-li">5<3}d ivclassNa="meco"><}d>
44AEco61B0uniq44A61B0Sy31<111" spans="tyle--0:#ECC48D;--1:#98">4E4Duniq1<111" spans="tyle--0:#D6DEEB;--1:#40">3F<53) ;divclass="Nameec-">44AEco61B0privat44A61B0Sy31<111" spans="tyle--0:#ECC48D;--1:#98">4E4Dprivat1<111" spans="tyle--0:#D6DEEB;--1:#40">3F<53) ;divclass="Nameec-">c44AEc31111MyC3F<53 {divclass="Nameec-">3F<53 spans="tyle--0:#D6DEEB;--1:#40">361B0Sy31<111" spans="tyle--0:#ECC48D;--1:#98">4E4DcustomMe1<111" spans="tyle--0:#D6DEEB;--1:#40">3F<53)] spans="tyle--0:#D9F5DD;--1:#11">11<11() spans="tyle--0:#D6DEEB;--1:#40">3F<53 {divclass="Nameec-">dent< spans="tyle--0:#C792EA;--1:#88">44AEre31<111" spans="tyle--0:#ECC48D;--1:#98">4E4Dme1<111" spans="tyle--0:#D6DEEB;--1:#40">33F<53 spans="tyle--0:#D6DEEB;--1:#40">33c6376// Well-known symbols don't need descript44AEco61B0iter44A3F53Sy4<4AE. spans="tyle--0:#7FDBCA;--1:#09">6E72iter3c6376// Symbol.for() creates global symbols with identif44AEco61B0globalSy44A3F53Sy4<4AE. spans="tyle--0:#82AAFF;--1:#3B">61B<0for spans="tyle--0:#D6DEEB;--1:#40">31<111" spans="tyle--0:#ECC48D;--1:#98">4E4Dapp.co1<111" spans="tyle--0:#D6DEEB;--1:#40">3F<53) ;divclass="Name">

This rule is not configurable.

If you’re working in a codebase where symbol descriptions aren’t important for debugging purposes, or if you dynamically create many anonymous symbols, you might choose to disable this rule.