Reports extending the prototype of native JavaScript objects.
✅ This rule is included in the ts javascript presets.
Extending native JavaScript prototypes like Array.prototype or Object.prototype affects all instances of that type across the entire codebase.
This can cause conflicts with other libraries that expect standard prototype behavior.
Future ECMAScript versions may add methods with the same name, causing unexpected behavior when those methods are overwritten.
B0ArrA72prototyAB0cust5<3 sp ansty="le--0:#C792EA;--1:#8844">A3 sp>5<3 sp ansty="le--0:#C792EA;--1:#8844">AEfuncti3 sp>5<3 sp ansty="le--0:#D9F5DD;--1:#1111">113 sp><()sp ansty="le--0:#D6DEEB;--1:#403F">53()sp>< {d ivclassNa="meec-li">nt< sp ansty="le--0:#C792EA;--1:#8844">AEretu sp>5<3 sp ansty="le--0:#7FDBCA;--1:#096E">72th3 sp>5 {d><3;d ivclassNa="meec-li">533;d><};d ivclassNa="meco"><};d>};d>};d>B0ObjeA72prototyA72meth5<3 sp ansty="le--0:#C792EA;--1:#8844">A3 sp>5<3 sp ansty="le--0:#F78C6C;--1:#AA09">8213 sp><23sp ansty="le--0:#D6DEEB;--1:#403F">523sp><3;d ivclassNa="meco"><3;d>3;d>3;d>B0StriA72prototyAB0toTitleCa5<3 sp ansty="le--0:#C792EA;--1:#8844">A3 sp>5<3 sp ansty="le--0:#C792EA;--1:#8844">AEfuncti3 sp>5<3 sp ansty="le--0:#D9F5DD;--1:#1111">113 sp><()sp ansty="le--0:#D6DEEB;--1:#403F">53()sp>< {d ivclassNa="meec-li">nt< sp ansty="le--0:#C792EA;--1:#8844">AEretu sp>5<3 sp ansty="le--0:#7FDBCA;--1:#096E">72th3 sp>AB0char5<3(sp ansty="le--0:#F78C6C;--1:#AA09">83(sp><20sp ansty="le--0:#D6DEEB;--1:#403F">520sp><3)sp ansty="le--0:#C792EA;--1:#8844">A3)sp>B0toUpperCa53(<) sp ansty="le--0:#C792EA;--1:#8844">A) sp>5<3 sp ansty="le--0:#7FDBCA;--1:#096E">72th3 sp>AB0sli5<3(sp ansty="le--0:#F78C6C;--1:#AA09">83(sp><21sp ansty="le--0:#D6DEEB;--1:#403F">5321sp> {d><);d ivclassNa="meec-li">53);d><};d ivclassNa="meco"><};d>};d>};d>53ObjeAB0defineProper5<3(sp ansty="le--0:#C5E478;--1:#3B61">B0Arr3(sp>A72prototy53<, sp ansty="le--0:#D9F5DD;--1:#1111">1, sp><1"sp ansty="le--0:#ECC48D;--1:#984E">4Dcust1"sp>1<1"sp ansty="le--0:#D6DEEB;--1:#403F">53,1"sp>< {d ivclassNa="meec-li">nt< sp ansty="le--0:#82AAFF;--1:#3B61">B0val sp>53<: sp ansty="le--0:#C792EA;--1:#8844">AEfuncti5<3 sp ansty="le--0:#D9F5DD;--1:#1111">113 sp><()sp ansty="le--0:#D6DEEB;--1:#403F">53 {()sp> {d><},d ivclassNa="meec-li">53}},d><);d ivclassNa="meco"><);d>);d>);d>53ObjeAB0defineProperti5<3(sp ansty="le--0:#C5E478;--1:#3B61">B0Obje3(sp>A72prototy53,< {d ivclassNa="meec-li">53< sp ansty="le--0:#D6DEEB;--1:#403F">53method: { value sp><: sp ansty="le--0:#F78C6C;--1:#AA09">821<23sp ansty="le--0:#D6DEEB;--1:#403F">53 23sp> {d><},d ivclassNa="meec-li">53}},d><);d ivclassNa="meco"><);d>);d>);d> 44AEfunc361B0customArrayMe31<111T spans="tyle--0:#D6DEEB;--1:#40">3111T> spans="tyle--0:#D9F5DD;--1:#11">1><111( spans="tyle--0:#D7DBE0;--1:#40">3F53a111(>631<111T spans="tyle--0:#D6DEEB;--1:#40">3F111T><53[] spans="tyle--0:#D9F5DD;--1:#11">153[]><111) spans="tyle--0:#7FDBCA;--1:#09">6111)>31<111T spans="tyle--0:#D6DEEB;--1:#40">3F53111T><[] {divclass="Nameec-">de44AEre3F53 ar[] >3(array: T[]): T[] { return arra"><}di vdivclass="Nameexpressive-">44AEc31111ExtendedA31<111T spans="tyle--0:#D6DEEB;--1:#40">3F111T><53> spans="tyle--0:#C792EA;--1:#88">44AEext53> >361B0A31<111T spans="tyle--0:#D6DEEB;--1:#40">3F5111T><3> {divclass="Nameec-">de61B0cu11<11() spans="tyle--0:#D6DEEB;--1:#40">3F11()>3> ><53 {divclass="Nameec-">dent< spans="tyle--0:#C792EA;--1:#88">44AEre >36E72353 >3F<53 spans="tyle--0:#D6DEEB;--1:#40">353 >3 extends Array { custom() { return this; ">< }> }>}di><}di vdivclass="Nameexpressive-">44AEfunc361B0toTitle1<111( spans="tyle--0:#D7DBE0;--1:#40">3F53v111(>6361B0st1<111) spans="tyle--0:#D6DEEB;--1:#40">3F111)><53 {divclass="Nameec-">de44AEre3F53 v4<4AE. spans="tyle--0:#82AAFF;--1:#3B">61B0ch4AE.>30<9820 spans="tyle--0:#D6DEEB;--1:#40">39820>4<4AE. spans="tyle--0:#82AAFF;--1:#3B">61B0toUpper4AE.>3F5<3() spans="tyle--0:#C792EA;--1:#88">43() ><4AE+ spans="tyle--0:#D6DEEB;--1:#40">3F53 v4AE+>4<4AE. spans="tyle--0:#82AAFF;--1:#3B">61B0s4AE.>30<9821 spans="tyle--0:#D6DEEB;--1:#40">3F9821>53 ><53) ;divclass="Nameec-">353)><);>);>}di><}di vdivclass="Nameexpressive-">44AEco61B0arrayU44AE< = {divclass="Nameec-">de61B0cu4<4AE< spans="tyle--0:#FFCB8B;--1:#11">14AE<><111T spans="tyle--0:#C792EA;--1:#88">4111T><4AE> spans="tyle--0:#D9F5DD;--1:#11">14AE>><111( spans="tyle--0:#D7DBE0;--1:#40">3F53a111(>64<4AE spans="tyle--0:#FFCB8B;--1:#11">14AE ><111T spans="tyle--0:#D6DEEB;--1:#40">3F111T><53[] spans="tyle--0:#D9F5DD;--1:#11">153[]><111) spans="tyle--0:#C792EA;--1:#88">44111)> = >44AE< spans="tyle--0:#C792EA;--1:#88">44AEret >3F53a4<4AE ;divclass="Nameec-">44444AE>4<4AE} spans="tyle--0:#D6DEEB;--1:#40">34AE}>(array: T[]) { return array; }"><,}>,}>}di>
This rule is not configurable.
If you are developing a polyfill library that intentionally adds missing standard methods to native prototypes, you may need to disable this rule.
Some frameworks also extend native prototypes as part of their core design, though this is increasingly rare in modern JavaScript development.