[{"data":1,"prerenderedAt":1999,"buildId":2000},["ShallowReactive",2],{"-extending-visitors":3,"-extending-visitors-surround":1896,"navigation_docs":1907},{"id":4,"title":5,"body":6,"description":1887,"extension":1888,"links":1889,"meta":1890,"navigation":101,"path":1892,"seo":1893,"stem":1894,"__hash__":1895},"docs\u002F9.extending\u002F2.visitors.md","Visitors",{"type":7,"value":8,"toc":1876},"minimark",[9,21,26,41,607,643,647,709,1380,1392,1522,1533,1537,1546,1613,1631,1635,1638,1668,1675,1685,1689,1692,1696,1706,1734,1741,1750,1763,1768,1872],[10,11,12,16,17,20],"p",{},[13,14,15],"code",{},"create(ctx)"," returns visitors keyed by ESTree node type, the same shape ESLint and oxlint use. Doctor walks each file's script once and calls a visitor only for nodes of its type. Add ",[13,18,19],{},":exit"," to run after the node's children.",[22,23,25],"h2",{"id":24},"script-nodes","Script nodes",[10,27,28,29,32,33,36,37,40],{},"This Rule reports every ",[13,30,31],{},"createClient()"," call after the first one in a module, with ",[13,34,35],{},"ACME0002"," registered next to ",[13,38,39],{},"ACME0001",":",[42,43,49],"pre",{"className":44,"code":45,"filename":46,"language":47,"meta":48,"style":48},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createRule, type ScriptAstNodeOf } from \"vite-doctor\u002Fextension\";\n\nexport const singleClient = createRule({\n  meta: {\n    id: \"acme\u002Fsingle-client\",\n    title: \"Create one Acme client per module\",\n    category: \"correctness\",\n    severity: \"warn\",\n    prefilter: { calls: [\"createClient\"] },\n  },\n  create(ctx) {\n    const clients: ScriptAstNodeOf\u003C\"CallExpression\">[] = [];\n    return {\n      CallExpression(node) {\n        if (node.callee.type === \"Identifier\" && node.callee.name === \"createClient\") {\n          clients.push(node);\n        }\n      },\n      \"Program:exit\"() {\n        for (const node of clients.slice(1)) {\n          ctx.report(\n            acmeDiagnostics.diagnostics.ACME0002({\n              why: \"Each client opens its own connection pool.\",\n              fix: \"Reuse the first client in this module.\",\n            }),\n            { range: ctx.range(node) },\n          );\n        }\n      },\n    };\n  },\n});\n","doctor\u002Fextension.ts","ts","",[13,50,51,96,103,128,140,158,175,192,209,240,246,263,300,308,323,383,402,408,414,430,464,478,497,514,531,541,568,576,581,586,592,597],{"__ignoreMap":48},[52,53,56,60,64,68,71,74,77,80,83,86,90,93],"span",{"class":54,"line":55},"line",1,[52,57,59],{"class":58},"s7zQu","import",[52,61,63],{"class":62},"sMK4o"," {",[52,65,67],{"class":66},"sTEyZ"," createRule",[52,69,70],{"class":62},",",[52,72,73],{"class":58}," type",[52,75,76],{"class":66}," ScriptAstNodeOf",[52,78,79],{"class":62}," }",[52,81,82],{"class":58}," from",[52,84,85],{"class":62}," \"",[52,87,89],{"class":88},"sfazB","vite-doctor\u002Fextension",[52,91,92],{"class":62},"\"",[52,94,95],{"class":62},";\n",[52,97,99],{"class":54,"line":98},2,[52,100,102],{"emptyLinePlaceholder":101},true,"\n",[52,104,106,109,113,116,119,122,125],{"class":54,"line":105},3,[52,107,108],{"class":58},"export",[52,110,112],{"class":111},"spNyl"," const",[52,114,115],{"class":66}," singleClient ",[52,117,118],{"class":62},"=",[52,120,67],{"class":121},"s2Zo4",[52,123,124],{"class":66},"(",[52,126,127],{"class":62},"{\n",[52,129,131,135,137],{"class":54,"line":130},4,[52,132,134],{"class":133},"swJcz","  meta",[52,136,40],{"class":62},[52,138,139],{"class":62}," {\n",[52,141,143,146,148,150,153,155],{"class":54,"line":142},5,[52,144,145],{"class":133},"    id",[52,147,40],{"class":62},[52,149,85],{"class":62},[52,151,152],{"class":88},"acme\u002Fsingle-client",[52,154,92],{"class":62},[52,156,157],{"class":62},",\n",[52,159,161,164,166,168,171,173],{"class":54,"line":160},6,[52,162,163],{"class":133},"    title",[52,165,40],{"class":62},[52,167,85],{"class":62},[52,169,170],{"class":88},"Create one Acme client per module",[52,172,92],{"class":62},[52,174,157],{"class":62},[52,176,178,181,183,185,188,190],{"class":54,"line":177},7,[52,179,180],{"class":133},"    category",[52,182,40],{"class":62},[52,184,85],{"class":62},[52,186,187],{"class":88},"correctness",[52,189,92],{"class":62},[52,191,157],{"class":62},[52,193,195,198,200,202,205,207],{"class":54,"line":194},8,[52,196,197],{"class":133},"    severity",[52,199,40],{"class":62},[52,201,85],{"class":62},[52,203,204],{"class":88},"warn",[52,206,92],{"class":62},[52,208,157],{"class":62},[52,210,212,215,217,219,222,224,227,229,232,234,237],{"class":54,"line":211},9,[52,213,214],{"class":133},"    prefilter",[52,216,40],{"class":62},[52,218,63],{"class":62},[52,220,221],{"class":133}," calls",[52,223,40],{"class":62},[52,225,226],{"class":66}," [",[52,228,92],{"class":62},[52,230,231],{"class":88},"createClient",[52,233,92],{"class":62},[52,235,236],{"class":66},"] ",[52,238,239],{"class":62},"},\n",[52,241,243],{"class":54,"line":242},10,[52,244,245],{"class":62},"  },\n",[52,247,249,252,254,258,261],{"class":54,"line":248},11,[52,250,251],{"class":133},"  create",[52,253,124],{"class":62},[52,255,257],{"class":256},"sHdIc","ctx",[52,259,260],{"class":62},")",[52,262,139],{"class":62},[52,264,266,269,272,274,277,280,282,285,287,290,293,295,298],{"class":54,"line":265},12,[52,267,268],{"class":111},"    const",[52,270,271],{"class":66}," clients",[52,273,40],{"class":62},[52,275,76],{"class":276},"sBMFI",[52,278,279],{"class":62},"\u003C",[52,281,92],{"class":62},[52,283,284],{"class":88},"CallExpression",[52,286,92],{"class":62},[52,288,289],{"class":62},">",[52,291,292],{"class":133},"[] ",[52,294,118],{"class":62},[52,296,297],{"class":133}," []",[52,299,95],{"class":62},[52,301,303,306],{"class":54,"line":302},13,[52,304,305],{"class":58},"    return",[52,307,139],{"class":62},[52,309,311,314,316,319,321],{"class":54,"line":310},14,[52,312,313],{"class":133},"      CallExpression",[52,315,124],{"class":62},[52,317,318],{"class":256},"node",[52,320,260],{"class":62},[52,322,139],{"class":62},[52,324,326,329,332,334,337,340,342,345,348,350,353,355,358,361,363,365,367,370,372,374,376,378,381],{"class":54,"line":325},15,[52,327,328],{"class":58},"        if",[52,330,331],{"class":133}," (",[52,333,318],{"class":66},[52,335,336],{"class":62},".",[52,338,339],{"class":66},"callee",[52,341,336],{"class":62},[52,343,344],{"class":66},"type",[52,346,347],{"class":62}," ===",[52,349,85],{"class":62},[52,351,352],{"class":88},"Identifier",[52,354,92],{"class":62},[52,356,357],{"class":62}," &&",[52,359,360],{"class":66}," node",[52,362,336],{"class":62},[52,364,339],{"class":66},[52,366,336],{"class":62},[52,368,369],{"class":66},"name",[52,371,347],{"class":62},[52,373,85],{"class":62},[52,375,231],{"class":88},[52,377,92],{"class":62},[52,379,380],{"class":133},") ",[52,382,127],{"class":62},[52,384,386,389,391,394,396,398,400],{"class":54,"line":385},16,[52,387,388],{"class":66},"          clients",[52,390,336],{"class":62},[52,392,393],{"class":121},"push",[52,395,124],{"class":133},[52,397,318],{"class":66},[52,399,260],{"class":133},[52,401,95],{"class":62},[52,403,405],{"class":54,"line":404},17,[52,406,407],{"class":62},"        }\n",[52,409,411],{"class":54,"line":410},18,[52,412,413],{"class":62},"      },\n",[52,415,417,420,423,425,428],{"class":54,"line":416},19,[52,418,419],{"class":62},"      \"",[52,421,422],{"class":88},"Program:exit",[52,424,92],{"class":62},[52,426,427],{"class":62},"()",[52,429,139],{"class":62},[52,431,433,436,438,441,443,446,448,450,453,455,459,462],{"class":54,"line":432},20,[52,434,435],{"class":58},"        for",[52,437,331],{"class":133},[52,439,440],{"class":111},"const",[52,442,360],{"class":66},[52,444,445],{"class":62}," of",[52,447,271],{"class":66},[52,449,336],{"class":62},[52,451,452],{"class":121},"slice",[52,454,124],{"class":133},[52,456,458],{"class":457},"sbssI","1",[52,460,461],{"class":133},")) ",[52,463,127],{"class":62},[52,465,467,470,472,475],{"class":54,"line":466},21,[52,468,469],{"class":66},"          ctx",[52,471,336],{"class":62},[52,473,474],{"class":121},"report",[52,476,477],{"class":133},"(\n",[52,479,481,484,486,489,491,493,495],{"class":54,"line":480},22,[52,482,483],{"class":66},"            acmeDiagnostics",[52,485,336],{"class":62},[52,487,488],{"class":66},"diagnostics",[52,490,336],{"class":62},[52,492,35],{"class":121},[52,494,124],{"class":133},[52,496,127],{"class":62},[52,498,500,503,505,507,510,512],{"class":54,"line":499},23,[52,501,502],{"class":133},"              why",[52,504,40],{"class":62},[52,506,85],{"class":62},[52,508,509],{"class":88},"Each client opens its own connection pool.",[52,511,92],{"class":62},[52,513,157],{"class":62},[52,515,517,520,522,524,527,529],{"class":54,"line":516},24,[52,518,519],{"class":133},"              fix",[52,521,40],{"class":62},[52,523,85],{"class":62},[52,525,526],{"class":88},"Reuse the first client in this module.",[52,528,92],{"class":62},[52,530,157],{"class":62},[52,532,534,537,539],{"class":54,"line":533},25,[52,535,536],{"class":62},"            }",[52,538,260],{"class":133},[52,540,157],{"class":62},[52,542,544,547,550,552,555,557,560,562,564,566],{"class":54,"line":543},26,[52,545,546],{"class":62},"            {",[52,548,549],{"class":133}," range",[52,551,40],{"class":62},[52,553,554],{"class":66}," ctx",[52,556,336],{"class":62},[52,558,559],{"class":121},"range",[52,561,124],{"class":133},[52,563,318],{"class":66},[52,565,380],{"class":133},[52,567,239],{"class":62},[52,569,571,574],{"class":54,"line":570},27,[52,572,573],{"class":133},"          )",[52,575,95],{"class":62},[52,577,579],{"class":54,"line":578},28,[52,580,407],{"class":62},[52,582,584],{"class":54,"line":583},29,[52,585,413],{"class":62},[52,587,589],{"class":54,"line":588},30,[52,590,591],{"class":62},"    };\n",[52,593,595],{"class":54,"line":594},31,[52,596,245],{"class":62},[52,598,600,603,605],{"class":54,"line":599},32,[52,601,602],{"class":62},"}",[52,604,260],{"class":66},[52,606,95],{"class":62},[10,608,609,610,612,613,616,617,619,620,627,628,631,632,635,636,638,639,642],{},"Each visitor's ",[13,611,318],{}," is typed for its key: ",[13,614,615],{},"CallExpression(node)"," receives a ",[13,618,284],{},". Script ASTs come from ",[621,622,626],"a",{"href":623,"rel":624},"https:\u002F\u002Foxc.rs\u002Fdocs\u002Fguide\u002Fusage\u002Fparser",[625],"nofollow","oxc-parser",", so node types match its ESTree output, TypeScript and JSX nodes included. To type a helper, use ",[13,629,630],{},"ScriptAstNodeOf\u003C\"CallExpression\">"," or the ",[13,633,634],{},"ScriptAstNode"," union from ",[13,637,89],{},". Vue SFC Rules can also use the ",[13,640,641],{},"SFC"," hook and template visitors.",[22,644,646],{"id":645},"template-nodes","Template nodes",[10,648,649,650,653,654,657,658,657,661,657,664,657,667,657,670,673,674,677,678,681,682,685,686,689,690,693,694,697,698,701,702,705,706,40],{},"For Vue SFCs, return a ",[13,651,652],{},"template"," object with visitors keyed by node kind: ",[13,655,656],{},"root",", ",[13,659,660],{},"element",[13,662,663],{},"attribute",[13,665,666],{},"directive",[13,668,669],{},"text",[13,671,672],{},"interpolation",", and ",[13,675,676],{},"comment",". Doctor walks the ",[13,679,680],{},"\u003Ctemplate>"," AST that ",[13,683,684],{},"@vue\u002Fcompiler-sfc"," builds when it parses the SFC, so template visitors add no parse of their own. This Rule reports ",[13,687,688],{},"\u003CAcmeImage>"," elements without alt text and ",[13,691,692],{},":src"," bindings to plain ",[13,695,696],{},"http:"," URLs, with ",[13,699,700],{},"ACME0003"," and ",[13,703,704],{},"ACME0004"," registered for ",[13,707,708],{},"acme\u002Fimage",[42,710,712],{"className":44,"code":711,"filename":46,"language":47,"meta":48,"style":48},"export const acmeImage = createRule({\n  meta: {\n    id: \"acme\u002Fimage\",\n    title: \"Use accessible, secure Acme images\",\n    category: \"a11y\",\n    severity: \"warn\",\n  },\n  create(ctx) {\n    return {\n      template: {\n        element(node) {\n          if (node.tag !== \"AcmeImage\") return;\n          if (\n            ctx.helpers.hasVueAttribute(node, \"alt\") ||\n            ctx.helpers.hasVueDirective(node, \"bind\", \"alt\")\n          )\n            return;\n          ctx.report(\n            acmeDiagnostics.diagnostics.ACME0003({\n              why: \"Screen readers announce an image without alt text by its file name.\",\n              fix: 'Add alt text, or alt=\"\" for a decorative image.',\n            }),\n            { range: ctx.range(node) },\n          );\n        },\n        directive(node, element) {\n          if (element.tag !== \"AcmeImage\" || node.name !== \"bind\" || node.arg?.content !== \"src\")\n            return;\n          const expression = node.exp && ctx.helpers.parseTemplateExpression(node.exp);\n          if (expression?.type !== \"Literal\" || !String(expression.value).startsWith(\"http:\"))\n            return;\n          ctx.report(\n            acmeDiagnostics.diagnostics.ACME0004({\n              why: \"An http: image on an https: page is mixed content that browsers upgrade or block.\",\n              fix: \"Serve the image over https:.\",\n            }),\n            { range: ctx.range(expression) },\n          );\n        },\n      },\n    };\n  },\n});\n",[13,713,714,731,739,753,768,783,797,801,813,819,828,841,872,879,912,949,954,961,971,987,1002,1019,1027,1049,1055,1060,1078,1141,1147,1190,1247,1253,1263,1280,1296,1312,1321,1344,1351,1356,1361,1366,1371],{"__ignoreMap":48},[52,715,716,718,720,723,725,727,729],{"class":54,"line":55},[52,717,108],{"class":58},[52,719,112],{"class":111},[52,721,722],{"class":66}," acmeImage ",[52,724,118],{"class":62},[52,726,67],{"class":121},[52,728,124],{"class":66},[52,730,127],{"class":62},[52,732,733,735,737],{"class":54,"line":98},[52,734,134],{"class":133},[52,736,40],{"class":62},[52,738,139],{"class":62},[52,740,741,743,745,747,749,751],{"class":54,"line":105},[52,742,145],{"class":133},[52,744,40],{"class":62},[52,746,85],{"class":62},[52,748,708],{"class":88},[52,750,92],{"class":62},[52,752,157],{"class":62},[52,754,755,757,759,761,764,766],{"class":54,"line":130},[52,756,163],{"class":133},[52,758,40],{"class":62},[52,760,85],{"class":62},[52,762,763],{"class":88},"Use accessible, secure Acme images",[52,765,92],{"class":62},[52,767,157],{"class":62},[52,769,770,772,774,776,779,781],{"class":54,"line":142},[52,771,180],{"class":133},[52,773,40],{"class":62},[52,775,85],{"class":62},[52,777,778],{"class":88},"a11y",[52,780,92],{"class":62},[52,782,157],{"class":62},[52,784,785,787,789,791,793,795],{"class":54,"line":160},[52,786,197],{"class":133},[52,788,40],{"class":62},[52,790,85],{"class":62},[52,792,204],{"class":88},[52,794,92],{"class":62},[52,796,157],{"class":62},[52,798,799],{"class":54,"line":177},[52,800,245],{"class":62},[52,802,803,805,807,809,811],{"class":54,"line":194},[52,804,251],{"class":133},[52,806,124],{"class":62},[52,808,257],{"class":256},[52,810,260],{"class":62},[52,812,139],{"class":62},[52,814,815,817],{"class":54,"line":211},[52,816,305],{"class":58},[52,818,139],{"class":62},[52,820,821,824,826],{"class":54,"line":242},[52,822,823],{"class":133},"      template",[52,825,40],{"class":62},[52,827,139],{"class":62},[52,829,830,833,835,837,839],{"class":54,"line":248},[52,831,832],{"class":133},"        element",[52,834,124],{"class":62},[52,836,318],{"class":256},[52,838,260],{"class":62},[52,840,139],{"class":62},[52,842,843,846,848,850,852,855,858,860,863,865,867,870],{"class":54,"line":265},[52,844,845],{"class":58},"          if",[52,847,331],{"class":133},[52,849,318],{"class":66},[52,851,336],{"class":62},[52,853,854],{"class":66},"tag",[52,856,857],{"class":62}," !==",[52,859,85],{"class":62},[52,861,862],{"class":88},"AcmeImage",[52,864,92],{"class":62},[52,866,380],{"class":133},[52,868,869],{"class":58},"return",[52,871,95],{"class":62},[52,873,874,876],{"class":54,"line":302},[52,875,845],{"class":58},[52,877,878],{"class":133}," (\n",[52,880,881,884,886,889,891,894,896,898,900,902,905,907,909],{"class":54,"line":310},[52,882,883],{"class":66},"            ctx",[52,885,336],{"class":62},[52,887,888],{"class":66},"helpers",[52,890,336],{"class":62},[52,892,893],{"class":121},"hasVueAttribute",[52,895,124],{"class":133},[52,897,318],{"class":66},[52,899,70],{"class":62},[52,901,85],{"class":62},[52,903,904],{"class":88},"alt",[52,906,92],{"class":62},[52,908,380],{"class":133},[52,910,911],{"class":62},"||\n",[52,913,914,916,918,920,922,925,927,929,931,933,936,938,940,942,944,946],{"class":54,"line":325},[52,915,883],{"class":66},[52,917,336],{"class":62},[52,919,888],{"class":66},[52,921,336],{"class":62},[52,923,924],{"class":121},"hasVueDirective",[52,926,124],{"class":133},[52,928,318],{"class":66},[52,930,70],{"class":62},[52,932,85],{"class":62},[52,934,935],{"class":88},"bind",[52,937,92],{"class":62},[52,939,70],{"class":62},[52,941,85],{"class":62},[52,943,904],{"class":88},[52,945,92],{"class":62},[52,947,948],{"class":133},")\n",[52,950,951],{"class":54,"line":385},[52,952,953],{"class":133},"          )\n",[52,955,956,959],{"class":54,"line":404},[52,957,958],{"class":58},"            return",[52,960,95],{"class":62},[52,962,963,965,967,969],{"class":54,"line":410},[52,964,469],{"class":66},[52,966,336],{"class":62},[52,968,474],{"class":121},[52,970,477],{"class":133},[52,972,973,975,977,979,981,983,985],{"class":54,"line":416},[52,974,483],{"class":66},[52,976,336],{"class":62},[52,978,488],{"class":66},[52,980,336],{"class":62},[52,982,700],{"class":121},[52,984,124],{"class":133},[52,986,127],{"class":62},[52,988,989,991,993,995,998,1000],{"class":54,"line":432},[52,990,502],{"class":133},[52,992,40],{"class":62},[52,994,85],{"class":62},[52,996,997],{"class":88},"Screen readers announce an image without alt text by its file name.",[52,999,92],{"class":62},[52,1001,157],{"class":62},[52,1003,1004,1006,1008,1011,1014,1017],{"class":54,"line":466},[52,1005,519],{"class":133},[52,1007,40],{"class":62},[52,1009,1010],{"class":62}," '",[52,1012,1013],{"class":88},"Add alt text, or alt=\"\" for a decorative image.",[52,1015,1016],{"class":62},"'",[52,1018,157],{"class":62},[52,1020,1021,1023,1025],{"class":54,"line":480},[52,1022,536],{"class":62},[52,1024,260],{"class":133},[52,1026,157],{"class":62},[52,1028,1029,1031,1033,1035,1037,1039,1041,1043,1045,1047],{"class":54,"line":499},[52,1030,546],{"class":62},[52,1032,549],{"class":133},[52,1034,40],{"class":62},[52,1036,554],{"class":66},[52,1038,336],{"class":62},[52,1040,559],{"class":121},[52,1042,124],{"class":133},[52,1044,318],{"class":66},[52,1046,380],{"class":133},[52,1048,239],{"class":62},[52,1050,1051,1053],{"class":54,"line":516},[52,1052,573],{"class":133},[52,1054,95],{"class":62},[52,1056,1057],{"class":54,"line":533},[52,1058,1059],{"class":62},"        },\n",[52,1061,1062,1065,1067,1069,1071,1074,1076],{"class":54,"line":543},[52,1063,1064],{"class":133},"        directive",[52,1066,124],{"class":62},[52,1068,318],{"class":256},[52,1070,70],{"class":62},[52,1072,1073],{"class":256}," element",[52,1075,260],{"class":62},[52,1077,139],{"class":62},[52,1079,1080,1082,1084,1086,1088,1090,1092,1094,1096,1098,1101,1103,1105,1107,1109,1111,1113,1115,1117,1119,1121,1124,1127,1130,1132,1134,1137,1139],{"class":54,"line":570},[52,1081,845],{"class":58},[52,1083,331],{"class":133},[52,1085,660],{"class":66},[52,1087,336],{"class":62},[52,1089,854],{"class":66},[52,1091,857],{"class":62},[52,1093,85],{"class":62},[52,1095,862],{"class":88},[52,1097,92],{"class":62},[52,1099,1100],{"class":62}," ||",[52,1102,360],{"class":66},[52,1104,336],{"class":62},[52,1106,369],{"class":66},[52,1108,857],{"class":62},[52,1110,85],{"class":62},[52,1112,935],{"class":88},[52,1114,92],{"class":62},[52,1116,1100],{"class":62},[52,1118,360],{"class":66},[52,1120,336],{"class":62},[52,1122,1123],{"class":66},"arg",[52,1125,1126],{"class":62},"?.",[52,1128,1129],{"class":66},"content",[52,1131,857],{"class":62},[52,1133,85],{"class":62},[52,1135,1136],{"class":88},"src",[52,1138,92],{"class":62},[52,1140,948],{"class":133},[52,1142,1143,1145],{"class":54,"line":578},[52,1144,958],{"class":58},[52,1146,95],{"class":62},[52,1148,1149,1152,1155,1158,1160,1162,1165,1167,1169,1171,1173,1175,1178,1180,1182,1184,1186,1188],{"class":54,"line":583},[52,1150,1151],{"class":111},"          const",[52,1153,1154],{"class":66}," expression",[52,1156,1157],{"class":62}," =",[52,1159,360],{"class":66},[52,1161,336],{"class":62},[52,1163,1164],{"class":66},"exp",[52,1166,357],{"class":62},[52,1168,554],{"class":66},[52,1170,336],{"class":62},[52,1172,888],{"class":66},[52,1174,336],{"class":62},[52,1176,1177],{"class":121},"parseTemplateExpression",[52,1179,124],{"class":133},[52,1181,318],{"class":66},[52,1183,336],{"class":62},[52,1185,1164],{"class":66},[52,1187,260],{"class":133},[52,1189,95],{"class":62},[52,1191,1192,1194,1196,1199,1201,1203,1205,1207,1210,1212,1214,1217,1220,1222,1224,1226,1229,1231,1233,1236,1238,1240,1242,1244],{"class":54,"line":588},[52,1193,845],{"class":58},[52,1195,331],{"class":133},[52,1197,1198],{"class":66},"expression",[52,1200,1126],{"class":62},[52,1202,344],{"class":66},[52,1204,857],{"class":62},[52,1206,85],{"class":62},[52,1208,1209],{"class":88},"Literal",[52,1211,92],{"class":62},[52,1213,1100],{"class":62},[52,1215,1216],{"class":62}," !",[52,1218,1219],{"class":121},"String",[52,1221,124],{"class":133},[52,1223,1198],{"class":66},[52,1225,336],{"class":62},[52,1227,1228],{"class":66},"value",[52,1230,260],{"class":133},[52,1232,336],{"class":62},[52,1234,1235],{"class":121},"startsWith",[52,1237,124],{"class":133},[52,1239,92],{"class":62},[52,1241,696],{"class":88},[52,1243,92],{"class":62},[52,1245,1246],{"class":133},"))\n",[52,1248,1249,1251],{"class":54,"line":594},[52,1250,958],{"class":58},[52,1252,95],{"class":62},[52,1254,1255,1257,1259,1261],{"class":54,"line":599},[52,1256,469],{"class":66},[52,1258,336],{"class":62},[52,1260,474],{"class":121},[52,1262,477],{"class":133},[52,1264,1266,1268,1270,1272,1274,1276,1278],{"class":54,"line":1265},33,[52,1267,483],{"class":66},[52,1269,336],{"class":62},[52,1271,488],{"class":66},[52,1273,336],{"class":62},[52,1275,704],{"class":121},[52,1277,124],{"class":133},[52,1279,127],{"class":62},[52,1281,1283,1285,1287,1289,1292,1294],{"class":54,"line":1282},34,[52,1284,502],{"class":133},[52,1286,40],{"class":62},[52,1288,85],{"class":62},[52,1290,1291],{"class":88},"An http: image on an https: page is mixed content that browsers upgrade or block.",[52,1293,92],{"class":62},[52,1295,157],{"class":62},[52,1297,1299,1301,1303,1305,1308,1310],{"class":54,"line":1298},35,[52,1300,519],{"class":133},[52,1302,40],{"class":62},[52,1304,85],{"class":62},[52,1306,1307],{"class":88},"Serve the image over https:.",[52,1309,92],{"class":62},[52,1311,157],{"class":62},[52,1313,1315,1317,1319],{"class":54,"line":1314},36,[52,1316,536],{"class":62},[52,1318,260],{"class":133},[52,1320,157],{"class":62},[52,1322,1324,1326,1328,1330,1332,1334,1336,1338,1340,1342],{"class":54,"line":1323},37,[52,1325,546],{"class":62},[52,1327,549],{"class":133},[52,1329,40],{"class":62},[52,1331,554],{"class":66},[52,1333,336],{"class":62},[52,1335,559],{"class":121},[52,1337,124],{"class":133},[52,1339,1198],{"class":66},[52,1341,380],{"class":133},[52,1343,239],{"class":62},[52,1345,1347,1349],{"class":54,"line":1346},38,[52,1348,573],{"class":133},[52,1350,95],{"class":62},[52,1352,1354],{"class":54,"line":1353},39,[52,1355,1059],{"class":62},[52,1357,1359],{"class":54,"line":1358},40,[52,1360,413],{"class":62},[52,1362,1364],{"class":54,"line":1363},41,[52,1365,591],{"class":62},[52,1367,1369],{"class":54,"line":1368},42,[52,1370,245],{"class":62},[52,1372,1374,1376,1378],{"class":54,"line":1373},43,[52,1375,602],{"class":62},[52,1377,260],{"class":66},[52,1379,95],{"class":62},[10,1381,1382,1383,657,1386,1389,1390,40],{},"Nodes are the compiler-dom nodes Vue's compiler produces, typed as ",[13,1384,1385],{},"TemplateElementNode",[13,1387,1388],{},"TemplateDirectiveNode",", and so on in ",[13,1391,89],{},[1393,1394,1395,1404,1414,1443,1475,1509],"ul",{},[1396,1397,1398,1399,701,1401,1403],"li",{},"Each visitor receives the node and its parent. ",[13,1400,663],{},[13,1402,666],{}," receive their element; other kinds receive their parent element or the template root.",[1396,1405,1406,1407,1410,1411,1413],{},"An element's attributes and directives are visited in source order before its children. ",[13,1408,1409],{},"\"element:exit\""," and the other ",[13,1412,19],{}," keys run after a node's props and children, so a Rule can track ancestors with a counter or stack.",[1396,1415,1416,1419,1420,657,1423,1426,1427,1430,1431,1434,1435,1438,1439,1442],{},[13,1417,1418],{},"element.tag"," is the tag as written, such as ",[13,1421,1422],{},"button",[13,1424,1425],{},"NuxtLink",", or ",[13,1428,1429],{},"router-view",". ",[13,1432,1433],{},"element.props"," holds static attributes (",[13,1436,1437],{},"type: 6",") and directives (",[13,1440,1441],{},"type: 7",").",[1396,1444,1445,1446,657,1449,673,1452,1455,1456,1458,1459,657,1461,673,1464,1467,1468,1430,1471,1474],{},"Directive shorthands are normalized: ",[13,1447,1448],{},":href",[13,1450,1451],{},"@click",[13,1453,1454],{},"#default"," have ",[13,1457,369],{}," ",[13,1460,935],{},[13,1462,1463],{},"on",[13,1465,1466],{},"slot",", with a static argument in ",[13,1469,1470],{},"arg.content",[13,1472,1473],{},"rawName"," keeps the name as written.",[1396,1476,1477,1478,1481,1482,1430,1485,1488,1489,1492,1493,1496,1497,1500,1501,1504,1505,1508],{},"A static attribute value is ",[13,1479,1480],{},"attribute.value?.content",". Directive values and interpolations are strings in ",[13,1483,1484],{},"exp.content",[13,1486,1487],{},"ctx.helpers.parseTemplateExpression(exp)"," parses one with oxc on first use and shares the result with every Rule. It returns ",[13,1490,1491],{},"null"," for a whole ",[13,1494,1495],{},"v-for"," (parse ",[13,1498,1499],{},"forParseResult.source","), ",[13,1502,1503],{},"v-slot"," parameters, and ",[13,1506,1507],{},"v-on"," handlers with several statements.",[1396,1510,1511,1512,1515,1516,1519,1520,336],{},"Template nodes and parsed expressions carry SFC offsets, so ",[13,1513,1514],{},"ctx.range(node)"," points at the source. ",[13,1517,1518],{},"ctx.file.templateAst"," is the root, for Rules that need the whole template in ",[13,1521,15],{},[10,1523,1524,1525,1528,1529,1532],{},"Template visitors don't run on ",[13,1526,1527],{},"\u003Ctemplate src>"," or on templates with a non-HTML ",[13,1530,1531],{},"lang",", such as Pug.",[22,1534,1536],{"id":1535},"prefilter","Prefilter",[10,1538,1539,1542,1543,1545],{},[13,1540,1541],{},"meta.prefilter"," skips a Rule on files that cannot produce its Diagnostics; Doctor doesn't call ",[13,1544,15],{}," for them. A Rule runs on a file when any listed signal is present:",[1547,1548,1549,1562],"table",{},[1550,1551,1552],"thead",{},[1553,1554,1555,1559],"tr",{},[1556,1557,1558],"th",{},"Field",[1556,1560,1561],{},"Matches",[1563,1564,1565,1587,1603],"tbody",{},[1553,1566,1567,1573],{},[1568,1569,1570],"td",{},[13,1571,1572],{},"calls",[1568,1574,1575,1576,1579,1580,1430,1583,1586],{},"Call expressions by callee name, such as ",[13,1577,1578],{},"useFetch"," or ",[13,1581,1582],{},"Math.random",[13,1584,1585],{},"new"," expressions don't count.",[1553,1588,1589,1594],{},[1568,1590,1591],{},[13,1592,1593],{},"imports",[1568,1595,1596,1597,1599,1600,336],{},"Static ",[13,1598,59],{}," declarations by exact source, such as ",[13,1601,1602],{},"acme\u002Flegacy",[1553,1604,1605,1610],{},[1568,1606,1607],{},[13,1608,1609],{},"names",[1568,1611,1612],{},"Names the file text could spell, including through escape sequences. Use it for aliases and reads.",[10,1614,1615,1616,657,1618,1620,1621,1624,1625,1627,1628,1630],{},"List every signal the Rule reports from. If a Rule also reports from ",[13,1617,15],{},[13,1619,641],{},", or template visitors, or follows aliases such as ",[13,1622,1623],{},"const load = createClient",", a ",[13,1626,1572],{}," prefilter can hide real Diagnostics. Use ",[13,1629,1609],{}," or leave the prefilter out.",[22,1632,1634],{"id":1633},"execution-order","Execution order",[10,1636,1637],{},"File Rules run one file at a time. For each file, Doctor:",[1639,1640,1641,1647,1656,1662],"ol",{},[1396,1642,1643,1644,1646],{},"skips Rules whose ",[13,1645,1541],{}," cannot match;",[1396,1648,1649,1650,1652,1653,1655],{},"awaits every remaining Rule's ",[13,1651,15],{}," in enabled-rule order, then every ",[13,1654,641],{}," hook in that order;",[1396,1657,1658,1659,1661],{},"walks the script once, depth first. Entering a node, it calls each Rule's visitor for that type in Rule order; after the node's children, it calls the ",[13,1660,19],{}," visitors the same way;",[1396,1663,1664,1665,1667],{},"walks the template with the same enter and exit order, using each Rule's ",[13,1666,652],{}," visitors.",[10,1669,1670,1671,1674],{},"All callbacks for one file finish before the next file's ",[13,1672,1673],{},"create()",". Diagnostics appear in Rule order, then file order.",[10,1676,1677,1678,1681,1682,1684],{},"Rule Packs that coordinate through shared module state or ",[13,1679,1680],{},"ctx.cache"," must not assume an earlier Rule has finished its callbacks when their ",[13,1683,1673],{}," runs. Use caches for reusable facts, not to sequence Rules.",[22,1686,1688],{"id":1687},"the-ast-is-read-only","The AST is read-only",[10,1690,1691],{},"Doctor links script parents before any visitor runs. Treat SFC, script, and template ASTs as read-only. Both traversals are snapshotted before callbacks, so replacing or removing children doesn't cancel their queued visits, and inserted children are not visited. The single-visitor runner works the same way. Doctor guarantees no behavior for AST mutations across Rules, so keep analysis state outside the AST.",[22,1693,1695],{"id":1694},"unknown-hooks","Unknown hooks",[10,1697,1698,1699,1701,1702,1705],{},"Doctor checks every visitor a Rule's ",[13,1700,1673],{}," returns, including when its hooks differ between files. A hook Doctor never calls stops the run with ",[13,1703,1704],{},"DOC0034",", naming the Rule and the hook:",[1393,1707,1708,1718,1725,1731],{},[1396,1709,1710,1711,1579,1714,1717],{},"a removed hook such as ",[13,1712,1713],{},"ScriptNode",[13,1715,1716],{},"TemplateNode",";",[1396,1719,1720,1721,1724],{},"a misspelled node type such as ",[13,1722,1723],{},"CallExpresion",", with the closest hook suggested;",[1396,1726,1727,1728,1730],{},"a ",[13,1729,652],{}," key that isn't a template node kind;",[1396,1732,1733],{},"a lifecycle hook on a file Rule, or a node visitor on a workspace or manifest Rule.",[10,1735,1736,1737,1740],{},"Script hooks are the node types in oxc-parser's visitor keys, so a type that never appears as a child of another node, such as ",[13,1738,1739],{},"Hashbang",", is rejected too.",[1742,1743,1745,1746,701,1748],"h3",{"id":1744},"migrate-from-scriptnode-and-templatenode","Migrate from ",[13,1747,1713],{},[13,1749,1716],{},[10,1751,1752,1753,1755,1756,1759,1760,336],{},"Move a ",[13,1754,1713],{}," body into visitors for the node types it checked: ",[13,1757,1758],{},"ScriptNode(node) { if (node.type !== \"CallExpression\") return; ... }"," becomes ",[13,1761,1762],{},"CallExpression(node) { ... }",[10,1764,1765,1767],{},[13,1766,1716],{}," went away with the vue-eslint-parser node shapes it received:",[1547,1769,1770,1780],{},[1550,1771,1772],{},[1553,1773,1774,1777],{},[1556,1775,1776],{},"Before",[1556,1778,1779],{},"After",[1563,1781,1782,1794,1804,1816,1833,1846,1857],{},[1553,1783,1784,1789],{},[1568,1785,1786],{},[13,1787,1788],{},"node.type === \"VElement\"",[1568,1790,1791],{},[13,1792,1793],{},"template: { element(node) {} }",[1553,1795,1796,1800],{},[1568,1797,1798],{},[13,1799,1473],{},[1568,1801,1802],{},[13,1803,854],{},[1553,1805,1806,1811],{},[1568,1807,1808],{},[13,1809,1810],{},"startTag.attributes",[1568,1812,1813],{},[13,1814,1815],{},"props",[1553,1817,1818,1827],{},[1568,1819,1820,1821,657,1824],{},"a directive's ",[13,1822,1823],{},"key.name.name",[13,1825,1826],{},"key.argument.name",[1568,1828,1829,657,1831],{},[13,1830,369],{},[13,1832,1470],{},[1553,1834,1835,1841],{},[1568,1836,1837,1838],{},"a static ",[13,1839,1840],{},"value.value",[1568,1842,1843],{},[13,1844,1845],{},"value.content",[1553,1847,1848,1853],{},[1568,1849,1850],{},[13,1851,1852],{},"value.expression",[1568,1854,1855],{},[13,1856,1487],{},[1553,1858,1859,1865],{},[1568,1860,1861,1864],{},[13,1862,1863],{},"parent"," chains",[1568,1866,1867,701,1869,1871],{},[13,1868,660],{},[13,1870,1409],{}," visitors",[1873,1874,1875],"style",{},"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 .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}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);}",{"title":48,"searchDepth":98,"depth":98,"links":1877},[1878,1879,1880,1881,1882,1883],{"id":24,"depth":98,"text":25},{"id":645,"depth":98,"text":646},{"id":1535,"depth":98,"text":1536},{"id":1633,"depth":98,"text":1634},{"id":1687,"depth":98,"text":1688},{"id":1694,"depth":98,"text":1695,"children":1884},[1885],{"id":1744,"depth":105,"text":1886},"Migrate from ScriptNode and TemplateNode","Visit script and template nodes, skip files with a prefilter, and the order Doctor runs file Rules in.","md",null,{"icon":1891},"i-lucide-scan-search","\u002Fextending\u002Fvisitors",{"title":5,"description":1887},"9.extending\u002F2.visitors","AuGDulQp2iv4oZwAmYQey_uwqbCi4UGnhY3xc0E1xKU",[1897,1902],{"title":1898,"path":1899,"stem":1900,"description":1901,"children":-1},"Write an extension","\u002Fextending","9.extending\u002F1.index","Write custom Rules, ship them with a Vite plugin or Nuxt module, and test them.",{"title":1903,"path":1904,"stem":1905,"description":1906,"children":-1},"Ship with a library","\u002Fextending\u002Fshipping","9.extending\u002F3.shipping","Ship Doctor Rules with a Vite plugin or a Nuxt module so users get them without setup.",[1908,1936,1940,1944,1948,1952,1956,1968,1972,1987,1991,1995],{"title":1909,"path":1910,"stem":1911,"children":1912,"icon":1935},"CLI","\u002Fcli","1.cli\u002F1.index",[1913,1915,1919,1923,1927,1931],{"title":1914,"path":1910,"stem":1911},"Run Doctor",{"title":1916,"path":1917,"stem":1918},"Reports","\u002Fcli\u002Freports","1.cli\u002F2.reports",{"title":1920,"path":1921,"stem":1922},"Configuration","\u002Fcli\u002Fconfiguration","1.cli\u002F3.configuration",{"title":1924,"path":1925,"stem":1926},"CI and changed files","\u002Fcli\u002Fci","1.cli\u002F4.ci",{"title":1928,"path":1929,"stem":1930},"Workspaces","\u002Fcli\u002Fworkspaces","1.cli\u002F5.workspaces",{"title":1932,"path":1933,"stem":1934},"Cache and speed","\u002Fcli\u002Fcache","1.cli\u002F6.cache","i-lucide-terminal",{"title":1937,"path":1938,"stem":1939},"Nuxt","\u002Fnuxt","2.nuxt",{"title":1941,"path":1942,"stem":1943},"Vue","\u002Fvue","3.vue",{"title":1945,"path":1946,"stem":1947},"Vite","\u002Fvite","4.vite",{"title":1949,"path":1950,"stem":1951},"Nitro","\u002Fnitro","5.nitro",{"title":1953,"path":1954,"stem":1955},"TypeScript","\u002Ftypescript","6.typescript",{"title":1957,"path":1958,"stem":1959,"children":1960,"icon":1967},"Design system","\u002Fdesign-system","7.design-system\u002F1.index",[1961,1963],{"title":1962,"path":1958,"stem":1959},"Overview",{"title":1964,"path":1965,"stem":1966},"Classes and styles","\u002Fdesign-system\u002Fclasses","7.design-system\u002F2.classes","i-lucide-swatch-book",{"title":1969,"path":1970,"stem":1971},"Package","\u002Fpackage","8.package",{"title":1973,"path":1899,"stem":1900,"children":1974,"icon":1986},"Extending Doctor",[1975,1976,1977,1978,1982],{"title":1898,"path":1899,"stem":1900},{"title":5,"path":1892,"stem":1894},{"title":1903,"path":1904,"stem":1905},{"title":1979,"path":1980,"stem":1981},"Test a Rule","\u002Fextending\u002Ftesting","9.extending\u002F4.testing",{"title":1983,"path":1984,"stem":1985},"Rule inputs","\u002Fextending\u002Frule-inputs","9.extending\u002F5.rule-inputs","i-lucide-puzzle",{"title":1988,"path":1989,"stem":1990},"H3","\u002Fh3","9.h3",{"title":1992,"path":1993,"stem":1994},"MCP","\u002Fmodel-context-protocol","9.model-context-protocol",{"title":1996,"path":1997,"stem":1998},"Pinia","\u002Fpinia","9.pinia",1796492443187,"1c82e0cf-90da-4346-b049-6ae71736a6b9"]