[{"data":1,"prerenderedAt":269},["ShallowReactive",2],{"navigation_docs":3,"diagnostic-content-TS0005":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,"code":258,"description":259,"docsUrl":58,"extension":260,"fix":261,"framework":262,"meta":263,"navigation":264,"pack":60,"path":265,"ruleId":61,"rulePath":62,"seo":266,"severity":63,"source":64,"sourceUrl":65,"stem":267,"why":74,"__hash__":268},"diagnostics\u002Fdiagnostics\u002FTS0005.md","TS0005: Validate deserialized values before typing them",{"type":52,"value":53,"toc":246},"minimark",[54,66,71,75,79,91,95,100,103,149,152,182,186,189,214,218,230,234,242],[55,56],"rule-metadata",{"category":57,"docsUrl":58,"fix":59,"pack":60,"ruleId":61,"rulePath":62,"severity":63,"source":64,"sourceUrl":65},"boundaries","https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002F2\u002Fnarrowing.html","structural-review","vite-doctor\u002Ftypescript","typescript\u002Fboundaries\u002Fno-unvalidated-deserialization","\u002Ftypescript\u002Frules\u002Fboundaries\u002Fno-unvalidated-deserialization","warn","src\u002Frule-packs\u002Ftypescript\u002Frules\u002Fno-unvalidated-deserialization.ts","https:\u002F\u002Fgithub.com\u002Fonmax\u002Fvite-doctor\u002Fblob\u002Fmain\u002Fsrc\u002Frule-packs\u002Ftypescript\u002Frules\u002Fno-unvalidated-deserialization.ts",[67,68,70],"h2",{"id":69},"why-it-happens","Why it happens",[72,73,74],"p",{},"JSON, Fetch API bodies, and browser storage contain runtime data. A TypeScript annotation or assertion does not validate that data, so malformed values can enter the program under a trusted domain type.",[67,76,78],{"id":77},"fix","Fix",[72,80,81,82,85,86,90],{},"Deserialize to unknown, or to a JSON type that claims nothing about the contents (unknown",[83,84],"span",{},", Record",[87,88,89],"code",{},"\u003Cstring, unknown>",", a JSON value union), and validate with the domain parser before using the value. Keep browser storage reads as string | null.",[67,92,94],{"id":93},"example","Example",[96,97,99],"h3",{"id":98},"validate-json-at-the-boundary","Validate JSON at the boundary",[72,101,102],{},"Before",[104,105,110],"pre",{"className":106,"code":107,"language":108,"meta":109,"style":109},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","const user = JSON.parse(text) as User\n","ts","",[87,111,112],{"__ignoreMap":109},[83,113,116,120,124,128,131,134,138,141,145],{"class":114,"line":115},"line",1,[83,117,119],{"class":118},"spNyl","const",[83,121,123],{"class":122},"sTEyZ"," user ",[83,125,127],{"class":126},"sMK4o","=",[83,129,130],{"class":122}," JSON",[83,132,133],{"class":126},".",[83,135,137],{"class":136},"s2Zo4","parse",[83,139,140],{"class":122},"(text) ",[83,142,144],{"class":143},"s7zQu","as",[83,146,148],{"class":147},"sBMFI"," User\n",[72,150,151],{},"After",[104,153,155],{"className":106,"code":154,"language":108,"meta":109,"style":109},"const user = UserSchema.parse(JSON.parse(text))\n",[87,156,157],{"__ignoreMap":109},[83,158,159,161,163,165,168,170,172,175,177,179],{"class":114,"line":115},[83,160,119],{"class":118},[83,162,123],{"class":122},[83,164,127],{"class":126},[83,166,167],{"class":122}," UserSchema",[83,169,133],{"class":126},[83,171,137],{"class":136},[83,173,174],{"class":122},"(JSON",[83,176,133],{"class":126},[83,178,137],{"class":136},[83,180,181],{"class":122},"(text))\n",[67,183,185],{"id":184},"verify-the-fix","Verify the fix",[72,187,188],{},"Run only this rule after editing so the report stays focused on the diagnostic you are closing:",[104,190,194],{"className":191,"code":192,"language":193,"meta":109,"style":109},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm vite-doctor . --rules typescript\u002Fboundaries\u002Fno-unvalidated-deserialization\n","bash",[87,195,196],{"__ignoreMap":109},[83,197,198,201,205,208,211],{"class":114,"line":115},[83,199,200],{"class":147},"pnpm",[83,202,204],{"class":203},"sfazB"," vite-doctor",[83,206,207],{"class":203}," .",[83,209,210],{"class":203}," --rules",[83,212,213],{"class":203}," typescript\u002Fboundaries\u002Fno-unvalidated-deserialization\n",[67,215,217],{"id":216},"useful-links","Useful links",[219,220,221],"ul",{},[222,223,224],"li",{},[225,226,229],"a",{"href":58,"rel":227},[228],"nofollow","Upstream docs",[67,231,233],{"id":232},"related-rule","Related rule",[219,235,236],{},[222,237,238],{},[225,239,240],{"href":62},[87,241,61],{},[243,244,245],"style",{},"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 .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 .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}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 .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}",{"title":109,"searchDepth":247,"depth":247,"links":248},2,[249,250,251,255,256,257],{"id":69,"depth":247,"text":70},{"id":77,"depth":247,"text":78},{"id":93,"depth":247,"text":94,"children":252},[253],{"id":98,"depth":254,"text":99},3,{"id":184,"depth":247,"text":185},{"id":216,"depth":247,"text":217},{"id":232,"depth":247,"text":233},"TS0005","Reject direct type claims on values returned by JSON parsing, Fetch API bodies, and browser storage.","md","Deserialize to unknown, or to a JSON type that claims nothing about the contents (unknown[], Record\u003Cstring, unknown>, a JSON value union), and validate with the domain parser before using the value. Keep browser storage reads as string | null.","typescript",{},true,"\u002Fdiagnostics\u002Fts0005",{"title":50,"description":259},"diagnostics\u002FTS0005","MtZCJNOTLJr3vFet7j9ieivhN8QfYHjEA626mJlDKyA",1795268816485]