Reports using empty destructuring patterns that destructure no values.
✅ This rule is included in the ts logical and logicalStrict presets.
Empty destructuring patterns like {} or [] don’t extract any values from the source object or array and serve no practical purpose.
These patterns are typically mistakes or leftover code from refactoring where variables were removed but the destructuring syntax remained.
AEconst {} <= sp ansty="le--0:#D6DEEB;--1:#403F">53objec= sp>AEconst [] <= sp ansty="le--0:#D6DEEB;--1:#403F">53arra= sp>dAEfuncti5<3 sp ansty="le--0:#82AAFF;--1:#3B61">B0proce3 sp>1<1(sp ansty="le--0:#D6DEEB;--1:#403F">531(sp><{}sp ansty="le--0:#D9F5DD;--1:#1111">1{}sp><1)sp ansty="le--0:#D6DEEB;--1:#403F">531)sp>< {d ivclassNa="meec-li">53< sp ansty="le--0:#D6DEEB;--1:#403F">53conso sp>AB0l5<3(sp ansty="le--0:#D9F5DD;--1:#1111">13(sp><1"sp ansty="le--0:#ECC48D;--1:#984E">4DNo values extract1"sp>1<1"sp ansty="le--0:#D6DEEB;--1:#403F">531"sp> {d><);d ivclassNa="meec-li">5);d><3}d ivclassNa="meec-li">d3}d>AEf53< (sp ansty="le--0:#C792EA;--1:#8844">AEconst { (sp><} sp ansty="le--0:#7FDBCA;--1:#096E">72} sp>53 items)< {d ivclassNa="meec-li">53< sp ansty="le--0:#D6DEEB;--1:#403F">53conso sp>AB0l5<3(sp ansty="le--0:#D9F5DD;--1:#1111">13(sp><1"sp ansty="le--0:#ECC48D;--1:#984E">4DNo values extracted in lo1"sp>1<1"sp ansty="le--0:#D6DEEB;--1:#403F">531"sp> {d><);d ivclassNa="meec-li">5);d><3}d ivclassNa="meco"><}d>}d>3}d> 44AEcons61B04461B<0age spans="tyle--0:#C792EA;--1:#88">44AE 0age><} = spans="tyle--0:#D6DEEB;--1:#40">3F53per} = >44AEcon61B0f4461B0se44AE<] = spans="tyle--0:#D6DEEB;--1:#40">3F53ar] = >c44AEfunc361B0pro1<111( spans="tyle--1:#40"><3F53 spans="tyle--0:#D6">DE3F53>DB111(>6<67B, spans="tyle--1:#40"><3F53 spans="tyle--0:#D6">D3F53>DBE0vDE67B,>1<111) spans="tyle--0:#D6DEEB;--1:#40">3F111)><53 {divclass="Nameec-">3F<53 spans="tyle--0:#D6DEEB;--1:#40">3F53con53 >4<4AE. spans="tyle--0:#82AAFF;--1:#3B">61B4AE.><0log spans="tyle--0:#D6DEEB;--1:#40">3F50log><3(id spans="tyle--0:#889FB2;--1:#4D">63(id><67B, spans="tyle--0:#D6DEEB;--1:#40">3F53 val67B,>53 >3c44A3F<53 ( spans="tyle--0:#C792EA;--1:#88">44AEcons53 (>61B0- 44A
6E<72of spans="tyle--0:#D6DEEB;--1:#40">3F53 item72of>3F<53 spans="tyle--0:#D6DEEB;--1:#40">3F53con53 >4<4AE. spans="tyle--0:#82AAFF;--1:#3B">61B4AE.><0log spans="tyle--0:#D6DEEB;--1:#40">3F53(it0log>3c6376// Empty object/array literals are fine (not destructur44AEco61B0e44AE <= {} spans="tyle--0:#D6DEEB;--1:#40">3= {}>44AEco61B0emptyA443F53< [] ;divclass="Name">var e=class e extends HTMLElement{static#e=new Map;tabs;panels;#t;#n=`starlight-synced-tabs__`;constructor(){super();let t=this.querySelector(`[role="tablist"]`);if(this.tabs=[...t.querySelectorAll(`[role="tab"]`)],this.panels=[...this.querySelectorAll(`:scope > [role="tabpanel"]`)],this.#t=this.dataset.syncKey,this.#t){let t=e.#e.get(this.#t)??[];t.push(this),e.#e.set(this.#t,t)}this.tabs.forEach((e,n)=>{e.addEventListener(`click`,e=>{e.preventDefault();let r=t.querySelector(`[aria-selected="true"]`);e.currentTarget!==r&&this.switchTab(e.currentTarget,n)}),e.addEventListener(`keydown`,e=>{let t=this.tabs.indexOf(e.currentTarget),n=e.key===`ArrowLeft`?t-1:e.key===`ArrowRight`?t+1:e.key===`Home`?0:e.key===`End`?this.tabs.length-1:null;n!==null&&this.tabs[n]&&(e.preventDefault(),this.switchTab(this.tabs[n],n))})})}switchTab(t,n,r=!0){if(!t)return;let i=r?this.getBoundingClientRect().top:0;this.tabs.forEach(e=>{e.setAttribute(`aria-selected`,`false`),e.setAttribute(`tabindex`,`-1`)}),this.panels.forEach(e=>{e.hidden=!0});let a=this.panels[n];a&&(a.hidden=!1),t.removeAttribute(`tabindex`),t.setAttribute(`aria-selected`,`true`),r&&(t.focus(),e.#i(this,t),window.scrollTo({top:window.scrollY+(this.getBoundingClientRect().top-i),behavior:`instant`}))}#r(e){this.#t&&typeof localStorage<`u`&&localStorage.setItem(this.#n+this.#t,e)}static#i(t,n){let r=t.#t,i=e.#a(n);if(!r||!i)return;let a=e.#e.get(r);if(a){for(let n of a){if(n===t)continue;let r=n.tabs.findIndex(t=>e.#a(t)===i);r!==-1&&n.switchTab(n.tabs[r],r,!1)}t.#r(i)}}static#a(e){return e.textContent?.trim()}};customElements.define(`starlight-tabs`,e);
This rule is not configurable.
If you have code that intentionally uses empty destructuring patterns for some reason (though this is rare), you might choose to disable this rule.
However, in most cases, empty destructuring patterns indicate an error or code that should be cleaned up.