[{"data":1,"prerenderedAt":577},["ShallowReactive",2],{"navigation_docs":3,"pinia-rules-index":48},[4,8,12,16,20,24,28,32,36,40,44],{"title":5,"path":6,"stem":7},"CLI","\u002Fcli","1.cli",{"title":9,"path":10,"stem":11},"Nuxt","\u002Fnuxt","2.nuxt",{"title":13,"path":14,"stem":15},"Vue","\u002Fvue","3.vue",{"title":17,"path":18,"stem":19},"Vite","\u002Fvite","4.vite",{"title":21,"path":22,"stem":23},"Nitro","\u002Fnitro","5.nitro",{"title":25,"path":26,"stem":27},"TypeScript","\u002Ftypescript","6.typescript",{"title":29,"path":30,"stem":31},"shadcn","\u002Fshadcn","7.shadcn",{"title":33,"path":34,"stem":35},"Package","\u002Fpackage","8.package",{"title":37,"path":38,"stem":39},"Extending Doctor","\u002Fextending","9.extending",{"title":41,"path":42,"stem":43},"MCP","\u002Fmcp","9.mcp",{"title":45,"path":46,"stem":47},"Pinia","\u002Fpinia","9.pinia",[49,302],{"id":50,"title":51,"body":52,"category":58,"description":289,"diagnosticCodes":290,"docsUrl":60,"extension":291,"fix":61,"framework":292,"meta":293,"navigation":294,"pack":62,"path":296,"recommendedReplacement":297,"ruleId":63,"seo":298,"severity":64,"source":65,"sourceUrl":66,"stem":299,"why":300,"__hash__":301},"rules\u002Fpinia\u002Frules\u002Fstores\u002Fstore-name-matches-id.md","Name store composables after their id",{"type":53,"value":54,"toc":280},"minimark",[55,67,72,110,114,122,126,133,137,149,153,158,161,229,232,276],[56,57],"rule-metadata",{"category":58,"diagnosticCodes":59,"docsUrl":60,"fix":61,"pack":62,"ruleId":63,"severity":64,"source":65,"sourceUrl":66},"stores","PINIA0002","https:\u002F\u002Fpinia.vuejs.org\u002Fcore-concepts\u002F#Defining-a-Store","no","vite-doctor\u002Fpinia","pinia\u002Fstores\u002Fstore-name-matches-id","info","src\u002Frule-packs\u002Fpinia\u002Frules\u002Fstore-name-matches-id.ts","https:\u002F\u002Fgithub.com\u002Fonmax\u002Fvite-doctor\u002Fblob\u002Fmain\u002Fsrc\u002Frule-packs\u002Fpinia\u002Frules\u002Fstore-name-matches-id.ts",[68,69,71],"h2",{"id":70},"run-this-rule","Run this rule",[73,74,79],"pre",{"className":75,"code":76,"language":77,"meta":78,"style":78},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm vite-doctor . --extends auto,pinia\u002Fstrict --rules pinia\u002Fstores\u002Fstore-name-matches-id\n","bash","",[80,81,82],"code",{"__ignoreMap":78},[83,84,87,91,95,98,101,104,107],"span",{"class":85,"line":86},"line",1,[83,88,90],{"class":89},"sBMFI","pnpm",[83,92,94],{"class":93},"sfazB"," vite-doctor",[83,96,97],{"class":93}," .",[83,99,100],{"class":93}," --extends",[83,102,103],{"class":93}," auto,pinia\u002Fstrict",[83,105,106],{"class":93}," --rules",[83,108,109],{"class":93}," pinia\u002Fstores\u002Fstore-name-matches-id\n",[68,111,113],{"id":112},"why-it-matters","Why it matters",[115,116,117,118,121],"p",{},"Pinia's convention is to name the ",[80,119,120],{},"defineStore()"," return value use followed by the store id and Store. When the composable name and the id drift apart, Devtools, SSR state keys, and HMR show an id that nobody can find by searching for the composable, and two stores can end up sharing an id unnoticed.",[68,123,125],{"id":124},"recommended-fix","Recommended fix",[115,127,128,129,132],{},"Rename the composable to use",[80,130,131],{},"\u003CId>","Store, or change the id so it describes the store the composable returns. Kebab-case, snake_case, and camelCase ids map to the same PascalCase name, so 'shopping-cart' and 'shoppingCart' both expect useShoppingCartStore.",[68,134,136],{"id":135},"useful-links","Useful links",[138,139,140],"ul",{},[141,142,143],"li",{},[144,145,148],"a",{"href":60,"rel":146},[147],"nofollow","Rule reference",[68,150,152],{"id":151},"example","Example",[154,155,157],"h3",{"id":156},"match-the-composable-name-to-the-store-id","Match the composable name to the store id",[115,159,160],{},"Before",[73,162,166],{"className":163,"code":164,"language":165,"meta":78,"style":78},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export const useBasket = defineStore('cart', () => {\n  \u002F* ... *\u002F\n})\n","ts",[80,167,168,213,220],{"__ignoreMap":78},[83,169,170,174,178,182,186,190,193,196,199,201,204,207,210],{"class":85,"line":86},[83,171,173],{"class":172},"s7zQu","export",[83,175,177],{"class":176},"spNyl"," const",[83,179,181],{"class":180},"sTEyZ"," useBasket ",[83,183,185],{"class":184},"sMK4o","=",[83,187,189],{"class":188},"s2Zo4"," defineStore",[83,191,192],{"class":180},"(",[83,194,195],{"class":184},"'",[83,197,198],{"class":93},"cart",[83,200,195],{"class":184},[83,202,203],{"class":184},",",[83,205,206],{"class":184}," ()",[83,208,209],{"class":176}," =>",[83,211,212],{"class":184}," {\n",[83,214,216],{"class":85,"line":215},2,[83,217,219],{"class":218},"sHwdD","  \u002F* ... *\u002F\n",[83,221,223,226],{"class":85,"line":222},3,[83,224,225],{"class":184},"}",[83,227,228],{"class":180},")\n",[115,230,231],{},"After",[73,233,235],{"className":163,"code":234,"language":165,"meta":78,"style":78},"export const useCartStore = defineStore('cart', () => {\n  \u002F* ... *\u002F\n})\n",[80,236,237,266,270],{"__ignoreMap":78},[83,238,239,241,243,246,248,250,252,254,256,258,260,262,264],{"class":85,"line":86},[83,240,173],{"class":172},[83,242,177],{"class":176},[83,244,245],{"class":180}," useCartStore ",[83,247,185],{"class":184},[83,249,189],{"class":188},[83,251,192],{"class":180},[83,253,195],{"class":184},[83,255,198],{"class":93},[83,257,195],{"class":184},[83,259,203],{"class":184},[83,261,206],{"class":184},[83,263,209],{"class":176},[83,265,212],{"class":184},[83,267,268],{"class":85,"line":215},[83,269,219],{"class":218},[83,271,272,274],{"class":85,"line":222},[83,273,225],{"class":184},[83,275,228],{"class":180},[277,278,279],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}",{"title":78,"searchDepth":215,"depth":215,"links":281},[282,283,284,285,286],{"id":70,"depth":215,"text":71},{"id":112,"depth":215,"text":113},{"id":124,"depth":215,"text":125},{"id":135,"depth":215,"text":136},{"id":151,"depth":215,"text":152,"children":287},[288],{"id":156,"depth":222,"text":157},"Name the variable that receives defineStore() use\u003CId>Store, matching the literal store id.",[59],"md","pinia",{},{"title":295},"Store names","\u002Fpinia\u002Frules\u002Fstores\u002Fstore-name-matches-id","Rename the composable to use\u003CId>Store, or change the id so it describes the store the composable returns. Kebab-case, snake_case, and camelCase ids map to the same PascalCase name, so 'shopping-cart' and 'shoppingCart' both expect useShoppingCartStore.",{"title":51,"description":289},"pinia\u002Frules\u002Fstores\u002Fstore-name-matches-id","Pinia's convention is to name the defineStore() return value use followed by the store id and Store. When the composable name and the id drift apart, Devtools, SSR state keys, and HMR show an id that nobody can find by searching for the composable, and two stores can end up sharing an id unnoticed.","4rUNIe7HFn1nyC0Jgt4d09_l7qy17b_04yCUaoL8lE4",{"id":303,"title":304,"body":305,"category":58,"description":566,"diagnosticCodes":567,"docsUrl":60,"extension":291,"fix":61,"framework":292,"meta":568,"navigation":569,"pack":62,"path":571,"recommendedReplacement":572,"ruleId":310,"seo":573,"severity":311,"source":312,"sourceUrl":313,"stem":574,"why":575,"__hash__":576},"rules\u002Fpinia\u002Frules\u002Fstores\u002Funique-store-id.md","Give every Pinia store a unique id",{"type":53,"value":306,"toc":557},[307,314,316,334,336,346,348,354,356,363,365,369,371,466,468,554],[56,308],{"category":58,"diagnosticCodes":309,"docsUrl":60,"fix":61,"pack":62,"ruleId":310,"severity":311,"source":312,"sourceUrl":313},"PINIA0001","pinia\u002Fstores\u002Funique-store-id","error","src\u002Frule-packs\u002Fpinia\u002Frules\u002Funique-store-id.ts","https:\u002F\u002Fgithub.com\u002Fonmax\u002Fvite-doctor\u002Fblob\u002Fmain\u002Fsrc\u002Frule-packs\u002Fpinia\u002Frules\u002Funique-store-id.ts",[68,315,71],{"id":70},[73,317,319],{"className":75,"code":318,"language":77,"meta":78,"style":78},"pnpm vite-doctor . --rules pinia\u002Fstores\u002Funique-store-id\n",[80,320,321],{"__ignoreMap":78},[83,322,323,325,327,329,331],{"class":85,"line":86},[83,324,90],{"class":89},[83,326,94],{"class":93},[83,328,97],{"class":93},[83,330,106],{"class":93},[83,332,333],{"class":93}," pinia\u002Fstores\u002Funique-store-id\n",[68,335,113],{"id":112},[115,337,338,339,342,343,345],{},"Pinia keys every store instance by its id. The first ",[80,340,341],{},"useStore()"," call for an id creates the store and caches it in the Pinia instance; every later ",[80,344,341],{}," call on that Pinia instance with the same id returns that cached instance without running its own setup or options. If both definitions use that instance, the second definition is silently ignored, so callers receive the first store's state, getters, and actions.",[68,347,125],{"id":124},[115,349,350,351,353],{},"Give each ",[80,352,120],{}," call its own id. If both definitions describe the same store, delete one and import the remaining composable everywhere.",[68,355,136],{"id":135},[138,357,358],{},[141,359,360],{},[144,361,148],{"href":60,"rel":362},[147],[68,364,152],{"id":151},[154,366,368],{"id":367},"use-one-id-per-store","Use one id per store",[115,370,160],{},[73,372,374],{"className":163,"code":373,"language":165,"meta":78,"style":78},"\u002F\u002F stores\u002Fcart.ts\nexport const useCartStore = defineStore('cart', () => { \u002F* ... *\u002F })\n\n\u002F\u002F stores\u002Fcheckout.ts\nexport const useCheckoutStore = defineStore('cart', () => { \u002F* ... *\u002F })\n",[80,375,376,381,418,424,430],{"__ignoreMap":78},[83,377,378],{"class":85,"line":86},[83,379,380],{"class":218},"\u002F\u002F stores\u002Fcart.ts\n",[83,382,383,385,387,389,391,393,395,397,399,401,403,405,407,410,413,416],{"class":85,"line":215},[83,384,173],{"class":172},[83,386,177],{"class":176},[83,388,245],{"class":180},[83,390,185],{"class":184},[83,392,189],{"class":188},[83,394,192],{"class":180},[83,396,195],{"class":184},[83,398,198],{"class":93},[83,400,195],{"class":184},[83,402,203],{"class":184},[83,404,206],{"class":184},[83,406,209],{"class":176},[83,408,409],{"class":184}," {",[83,411,412],{"class":218}," \u002F* ... *\u002F",[83,414,415],{"class":184}," }",[83,417,228],{"class":180},[83,419,420],{"class":85,"line":222},[83,421,423],{"emptyLinePlaceholder":422},true,"\n",[83,425,427],{"class":85,"line":426},4,[83,428,429],{"class":218},"\u002F\u002F stores\u002Fcheckout.ts\n",[83,431,433,435,437,440,442,444,446,448,450,452,454,456,458,460,462,464],{"class":85,"line":432},5,[83,434,173],{"class":172},[83,436,177],{"class":176},[83,438,439],{"class":180}," useCheckoutStore ",[83,441,185],{"class":184},[83,443,189],{"class":188},[83,445,192],{"class":180},[83,447,195],{"class":184},[83,449,198],{"class":93},[83,451,195],{"class":184},[83,453,203],{"class":184},[83,455,206],{"class":184},[83,457,209],{"class":176},[83,459,409],{"class":184},[83,461,412],{"class":218},[83,463,415],{"class":184},[83,465,228],{"class":180},[115,467,231],{},[73,469,471],{"className":163,"code":470,"language":165,"meta":78,"style":78},"\u002F\u002F stores\u002Fcart.ts\nexport const useCartStore = defineStore('cart', () => { \u002F* ... *\u002F })\n\n\u002F\u002F stores\u002Fcheckout.ts\nexport const useCheckoutStore = defineStore('checkout', () => { \u002F* ... *\u002F })\n",[80,472,473,477,511,515,519],{"__ignoreMap":78},[83,474,475],{"class":85,"line":86},[83,476,380],{"class":218},[83,478,479,481,483,485,487,489,491,493,495,497,499,501,503,505,507,509],{"class":85,"line":215},[83,480,173],{"class":172},[83,482,177],{"class":176},[83,484,245],{"class":180},[83,486,185],{"class":184},[83,488,189],{"class":188},[83,490,192],{"class":180},[83,492,195],{"class":184},[83,494,198],{"class":93},[83,496,195],{"class":184},[83,498,203],{"class":184},[83,500,206],{"class":184},[83,502,209],{"class":176},[83,504,409],{"class":184},[83,506,412],{"class":218},[83,508,415],{"class":184},[83,510,228],{"class":180},[83,512,513],{"class":85,"line":222},[83,514,423],{"emptyLinePlaceholder":422},[83,516,517],{"class":85,"line":426},[83,518,429],{"class":218},[83,520,521,523,525,527,529,531,533,535,538,540,542,544,546,548,550,552],{"class":85,"line":432},[83,522,173],{"class":172},[83,524,177],{"class":176},[83,526,439],{"class":180},[83,528,185],{"class":184},[83,530,189],{"class":188},[83,532,192],{"class":180},[83,534,195],{"class":184},[83,536,537],{"class":93},"checkout",[83,539,195],{"class":184},[83,541,203],{"class":184},[83,543,206],{"class":184},[83,545,209],{"class":176},[83,547,409],{"class":184},[83,549,412],{"class":218},[83,551,415],{"class":184},[83,553,228],{"class":180},[277,555,556],{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}",{"title":78,"searchDepth":215,"depth":215,"links":558},[559,560,561,562,563],{"id":70,"depth":215,"text":71},{"id":112,"depth":215,"text":113},{"id":124,"depth":215,"text":125},{"id":135,"depth":215,"text":136},{"id":151,"depth":215,"text":152,"children":564},[565],{"id":367,"depth":222,"text":368},"Report possible collisions between literal store ids across the project.",[309],{},{"title":570},"Unique store ids","\u002Fpinia\u002Frules\u002Fstores\u002Funique-store-id","Give each defineStore() call its own id. If both definitions describe the same store, delete one and import the remaining composable everywhere.",{"title":304,"description":566},"pinia\u002Frules\u002Fstores\u002Funique-store-id","Pinia keys every store instance by its id. The first useStore() call for an id creates the store and caches it in the Pinia instance; every later useStore() call on that Pinia instance with the same id returns that cached instance without running its own setup or options. If both definitions use that instance, the second definition is silently ignored, so callers receive the first store's state, getters, and actions.","9ocu6aeEmp_TZo_iCKr0wtE0ixNPIMecc3oF_85WBa0",1795268783103]