[{"data":1,"prerenderedAt":301},["ShallowReactive",2],{"navigation_docs":3,"rule-content-\u002Fpinia\u002Frules\u002Fstores\u002Fstore-name-matches-id":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",{"id":49,"title":50,"body":51,"category":57,"description":288,"diagnosticCodes":289,"docsUrl":59,"extension":290,"fix":60,"framework":291,"meta":292,"navigation":293,"pack":61,"path":295,"recommendedReplacement":296,"ruleId":62,"seo":297,"severity":63,"source":64,"sourceUrl":65,"stem":298,"why":299,"__hash__":300},"rules\u002Fpinia\u002Frules\u002Fstores\u002Fstore-name-matches-id.md","Name store composables after their id",{"type":52,"value":53,"toc":279},"minimark",[54,66,71,109,113,121,125,132,136,148,152,157,160,228,231,275],[55,56],"rule-metadata",{"category":57,"diagnosticCodes":58,"docsUrl":59,"fix":60,"pack":61,"ruleId":62,"severity":63,"source":64,"sourceUrl":65},"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",[67,68,70],"h2",{"id":69},"run-this-rule","Run this rule",[72,73,78],"pre",{"className":74,"code":75,"language":76,"meta":77,"style":77},"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","",[79,80,81],"code",{"__ignoreMap":77},[82,83,86,90,94,97,100,103,106],"span",{"class":84,"line":85},"line",1,[82,87,89],{"class":88},"sBMFI","pnpm",[82,91,93],{"class":92},"sfazB"," vite-doctor",[82,95,96],{"class":92}," .",[82,98,99],{"class":92}," --extends",[82,101,102],{"class":92}," auto,pinia\u002Fstrict",[82,104,105],{"class":92}," --rules",[82,107,108],{"class":92}," pinia\u002Fstores\u002Fstore-name-matches-id\n",[67,110,112],{"id":111},"why-it-matters","Why it matters",[114,115,116,117,120],"p",{},"Pinia's convention is to name the ",[79,118,119],{},"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.",[67,122,124],{"id":123},"recommended-fix","Recommended fix",[114,126,127,128,131],{},"Rename the composable to use",[79,129,130],{},"\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.",[67,133,135],{"id":134},"useful-links","Useful links",[137,138,139],"ul",{},[140,141,142],"li",{},[143,144,147],"a",{"href":59,"rel":145},[146],"nofollow","Rule reference",[67,149,151],{"id":150},"example","Example",[153,154,156],"h3",{"id":155},"match-the-composable-name-to-the-store-id","Match the composable name to the store id",[114,158,159],{},"Before",[72,161,165],{"className":162,"code":163,"language":164,"meta":77,"style":77},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export const useBasket = defineStore('cart', () => {\n  \u002F* ... *\u002F\n})\n","ts",[79,166,167,212,219],{"__ignoreMap":77},[82,168,169,173,177,181,185,189,192,195,198,200,203,206,209],{"class":84,"line":85},[82,170,172],{"class":171},"s7zQu","export",[82,174,176],{"class":175},"spNyl"," const",[82,178,180],{"class":179},"sTEyZ"," useBasket ",[82,182,184],{"class":183},"sMK4o","=",[82,186,188],{"class":187},"s2Zo4"," defineStore",[82,190,191],{"class":179},"(",[82,193,194],{"class":183},"'",[82,196,197],{"class":92},"cart",[82,199,194],{"class":183},[82,201,202],{"class":183},",",[82,204,205],{"class":183}," ()",[82,207,208],{"class":175}," =>",[82,210,211],{"class":183}," {\n",[82,213,215],{"class":84,"line":214},2,[82,216,218],{"class":217},"sHwdD","  \u002F* ... *\u002F\n",[82,220,222,225],{"class":84,"line":221},3,[82,223,224],{"class":183},"}",[82,226,227],{"class":179},")\n",[114,229,230],{},"After",[72,232,234],{"className":162,"code":233,"language":164,"meta":77,"style":77},"export const useCartStore = defineStore('cart', () => {\n  \u002F* ... *\u002F\n})\n",[79,235,236,265,269],{"__ignoreMap":77},[82,237,238,240,242,245,247,249,251,253,255,257,259,261,263],{"class":84,"line":85},[82,239,172],{"class":171},[82,241,176],{"class":175},[82,243,244],{"class":179}," useCartStore ",[82,246,184],{"class":183},[82,248,188],{"class":187},[82,250,191],{"class":179},[82,252,194],{"class":183},[82,254,197],{"class":92},[82,256,194],{"class":183},[82,258,202],{"class":183},[82,260,205],{"class":183},[82,262,208],{"class":175},[82,264,211],{"class":183},[82,266,267],{"class":84,"line":214},[82,268,218],{"class":217},[82,270,271,273],{"class":84,"line":221},[82,272,224],{"class":183},[82,274,227],{"class":179},[276,277,278],"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":77,"searchDepth":214,"depth":214,"links":280},[281,282,283,284,285],{"id":69,"depth":214,"text":70},{"id":111,"depth":214,"text":112},{"id":123,"depth":214,"text":124},{"id":134,"depth":214,"text":135},{"id":150,"depth":214,"text":151,"children":286},[287],{"id":155,"depth":221,"text":156},"Name the variable that receives defineStore() use\u003CId>Store, matching the literal store id.",[58],"md","pinia",{},{"title":294},"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":50,"description":288},"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",1795268807850]