[{"data":1,"prerenderedAt":768,"buildId":769},["ShallowReactive",2],{"docs:\u002Fguide\u002Fcorpus":3},{"page":4,"section":16,"document":17,"credits":10,"prev":763,"next":766},{"id":5,"path":6,"file":7,"title":8,"sourceTitle":8,"description":9,"tagline":9,"eyebrow":10,"credits":10,"keywords":11,"icon":12,"layout":13,"sidebar":14,"toc":14,"kind":10,"group":10,"navigation":14,"order":15},"corpus","\u002Fguide\u002Fcorpus","guide\u002Fcorpus.md","defineCorpus","Build a corpus in TypeScript with defineCorpus for skip, wholeLabel, and merging corpora, then pass it to the tool that needs it.",null,[],"i-lucide-book-marked","article",true,4,"guide",{"nodes":18,"toc":756},[19,43,265,290,298,301,390,396,507,513,566,643,660,665,688,693,703],[20,21,22,23,31,32,34,35,38,39,42],"p",{},"Most projects only need ",[24,25,27],"a",{"href":26},"\u002Fguide\u002Fglossary",[28,29,30],"code",{},".agents\u002Fglossary.md",". Build a corpus in TypeScript with ",[28,33,8],{}," when you need options the glossary has no field for (",[28,36,37],{},"skip",", ",[28,40,41],{},"wholeLabel",") or want to merge corpora across packages, then pass it to the tool that needs it. There is no config file that glosslint finds on its own.",[44,45,48],"pre",{"language":46,"class":47,"wrap":14},"ts","shiki shiki-themes github-light-default github-dark-default dark:github-dark-default",[28,49,51,74,75,74,77,74,96,74,107,74,112,74,117,74,128,74,138,74,148,74,158,74,181,74,198,74,215,74,225,74,240,74,245,74,250,74,260],{"class":50},"language-ts",[52,53,56,60,64,67,71],"span",{"class":54,"style":55},"line","display: inline",[52,57,59],{"style":58},"color:#CF222E;--shiki-dark:#FF7B72","import",[52,61,63],{"style":62},"color:#1F2328;--shiki-dark:#E6EDF3"," { defineCorpus, fromGlossary } ",[52,65,66],{"style":58},"from",[52,68,70],{"style":69},"color:#0A3069;--shiki-dark:#A5D6FF"," \"glosslint\"",[52,72,73],{"style":62},";","\n",[52,76],{"class":54,"style":55},[52,78,79,82,86,89,93],{"class":54,"style":55},[52,80,81],{"style":58},"const",[52,83,85],{"style":84},"color:#0550AE;--shiki-dark:#79C0FF"," corpus",[52,87,88],{"style":58}," =",[52,90,92],{"style":91},"color:#8250DF;--shiki-dark:#D2A8FF"," defineCorpus",[52,94,95],{"style":62},"({",[52,97,98,101,104],{"class":54,"style":55},[52,99,100],{"style":62},"  extends: [",[52,102,103],{"style":91},"fromGlossary",[52,105,106],{"style":62},"()],",[52,108,109],{"class":54,"style":55},[52,110,111],{"style":62},"  terms: [",[52,113,114],{"class":54,"style":55},[52,115,116],{"style":62},"    {",[52,118,119,122,125],{"class":54,"style":55},[52,120,121],{"style":62},"      term: ",[52,123,124],{"style":69},"\"Dock\"",[52,126,127],{"style":62},",",[52,129,130,133,136],{"class":54,"style":55},[52,131,132],{"style":62},"      description: ",[52,134,135],{"style":69},"\"A powered stand where one bike is locked.\"",[52,137,127],{"style":62},[52,139,140,143,146],{"class":54,"style":55},[52,141,142],{"style":62},"      nuance: ",[52,144,145],{"style":69},"\"A station is a group of docks.\"",[52,147,127],{"style":62},[52,149,150,153,156],{"class":54,"style":55},[52,151,152],{"style":62},"      why: ",[52,154,155],{"style":69},"'Riders read \"dock\" on the stand itself.'",[52,157,127],{"style":62},[52,159,160,163,166,169,172,175,178],{"class":54,"style":55},[52,161,162],{"style":62},"      avoid: [{ word: ",[52,164,165],{"style":69},"\"rack\"",[52,167,168],{"style":62},", why: ",[52,170,171],{"style":69},"\"Racks are unpowered.\"",[52,173,174],{"style":62}," }, ",[52,176,177],{"style":69},"\"bay\"",[52,179,180],{"style":62},"],",[52,182,183,186,189,192,195],{"class":54,"style":55},[52,184,185],{"style":62},"      examples: { good: [",[52,187,188],{"style":69},"\"Return the bike to any dock\"",[52,190,191],{"style":62},"], bad: [",[52,193,194],{"style":69},"\"Return the bike to any rack\"",[52,196,197],{"style":62},"] },",[52,199,200,203,206,209,212],{"class":54,"style":55},[52,201,202],{"style":62},"      links: [{ title: ",[52,204,205],{"style":69},"\"Docks\"",[52,207,208],{"style":62},", url: ",[52,210,211],{"style":69},"\"https:\u002F\u002Fexample.com\u002Fdocs\u002Fdocks\"",[52,213,214],{"style":62}," }],",[52,216,217,220,222],{"class":54,"style":55},[52,218,219],{"style":62},"      translations: { de: ",[52,221,124],{"style":69},[52,223,224],{"style":62}," },",[52,226,227,230,233,235,238],{"class":54,"style":55},[52,228,229],{"style":62},"      forms: { de: [",[52,231,232],{"style":69},"\"Dockingstation\"",[52,234,38],{"style":62},[52,236,237],{"style":69},"\"Dockingstationen\"",[52,239,197],{"style":62},[52,241,242],{"class":54,"style":55},[52,243,244],{"style":62},"    },",[52,246,247],{"class":54,"style":55},[52,248,249],{"style":62},"  ],",[52,251,252,255,258],{"class":54,"style":55},[52,253,254],{"style":62},"  wholeLabel: ",[52,256,257],{"style":84},"true",[52,259,127],{"style":62},[52,261,262],{"class":54,"style":55},[52,263,264],{"style":62},"});",[20,266,267,270,271,273,274,277,278,280,281,284,285,289],{},[28,268,269],{},"fromGlossary()"," reads ",[28,272,30],{}," from the working directory; pass ",[28,275,276],{},"fromGlossary(new URL(\".\u002Fdocs\u002Fglossary.md\", import.meta.url))"," for another path. ",[28,279,8],{}," validates on load and throws ",[28,282,283],{},"GlosslintConfigError"," on mistakes (",[24,286,288],{"href":287},"\u002Fguide\u002Fconfig-errors","Config and glossary errors",").",[291,292,297],"h2",{"id":293,"anchor":294},"pass-the-corpus-to-a-tool",{"label":295,"icon":296},"Section titled \"Pass the corpus to a tool\"","#","Pass the corpus to a tool",[20,299,300],{},"Write the corpus inline in the tool's config, or export it from any module and import it where you need it.",[302,303,304,324,343,374],"ul",{},[305,306,307,311,312,315,316,319,320,289],"li",{},[308,309,310],"strong",{},"ESLint."," ",[28,313,314],{},"glosslint({ corpus })"," in ",[28,317,318],{},"eslint.config.ts"," (",[24,321,323],{"href":322},"\u002Fintegrations\u002Feslint","ESLint",[305,325,326,311,329,315,331,334,335,338,339,289],{},[308,327,328],{},"x18n.",[28,330,314],{},[28,332,333],{},"x18n.config.ts",", and ",[28,336,337],{},"toX18nGlossary(corpus)"," for the translation glossary (",[24,340,342],{"href":341},"\u002Fintegrations\u002Fx18n","x18n",[305,344,345,311,348,351,352,38,355,38,358,334,361,364,365,369,370,373],{},[308,346,347],{},"CLI.",[28,349,350],{},"--corpus \u003Cmodule>"," on ",[28,353,354],{},"check",[28,356,357],{},"test",[28,359,360],{},"print",[28,362,363],{},"explain",", where the module's default export is the corpus (",[24,366,368],{"href":367},"\u002Fintegrations\u002Fcli","CLI","). ",[28,371,372],{},"doctor"," reads only the Markdown glossary.",[305,375,376,379,380,382,383,319,386,289],{},[308,377,378],{},"Oxlint."," Takes no corpus: it reads ",[28,381,30],{}," or ",[28,384,385],{},"settings.glosslint.glossary",[24,387,389],{"href":388},"\u002Fintegrations\u002Foxlint","Oxlint",[291,391,395],{"id":392,"anchor":393},"corpus-fields",{"label":394,"icon":296},"Section titled \"Corpus fields\"","Corpus fields",[397,398,399,412],"table",{},[400,401,402],"thead",{},[403,404,405,409],"tr",{},[406,407,408],"th",{},"Field",[406,410,411],{},"What it does",[413,414,415,441,455,469,490],"tbody",{},[403,416,417,423],{},[418,419,420],"td",{},[28,421,422],{},"extends",[418,424,425,426,38,429,433,434,319,437,289],{},"Corpora merged first: ",[28,427,428],{},"fromGlossary(...)",[24,430,432],{"href":431},"\u002Fguide\u002Fpresets","presets",", or another ",[28,435,436],{},"defineCorpus(...)",[24,438,440],{"href":439},"#merge-order","Merge order",[403,442,443,448],{},[418,444,445],{},[28,446,447],{},"terms",[418,449,450,451,454],{},"Term objects. Shared fields match ",[24,452,453],{"href":26},"The glossary file","; TypeScript-only fields follow below.",[403,456,457,462],{},[418,458,459],{},[28,460,461],{},"allow",[418,463,464,465,289],{},"Phrases never reported (",[24,466,468],{"href":467},"#allowing-phrases","Allowing phrases",[403,470,471,476],{},[418,472,473],{},[28,474,475],{},"casing",[418,477,478,479,482,483,319,486,289],{},"Default style for ",[28,480,481],{},"context"," terms: ",[28,484,485],{},"{ label, header, sentence }",[24,487,489],{"href":488},"\u002Fguide\u002Fcasing","Casing rules",[403,491,492,496],{},[418,493,494],{},[28,495,41],{},[418,497,498,499,501,502,504,505,289],{},"Set ",[28,500,257],{}," to check every word of a label or header holding a ",[28,503,481],{}," term (",[24,506,489],{"href":488},[291,508,512],{"id":509,"anchor":510},"typescript-only-term-fields",{"label":511,"icon":296},"Section titled \"TypeScript-only term fields\"","TypeScript-only term fields",[20,514,515,516,38,519,38,522,38,525,38,528,38,531,38,534,38,537,38,540,38,543,38,545,38,548,551,552,554,555,557,558,334,560,562,563,565],{},"Shared term fields (",[28,517,518],{},"term",[28,520,521],{},"abbr",[28,523,524],{},"description",[28,526,527],{},"nuance",[28,529,530],{},"why",[28,532,533],{},"avoid",[28,535,536],{},"examples",[28,538,539],{},"links",[28,541,542],{},"case",[28,544,475],{},[28,546,547],{},"translations",[28,549,550],{},"forms",") are documented in ",[24,553,453],{"href":26},". ",[28,556,37],{}," exists only in ",[28,559,8],{},[28,561,550],{}," and ",[28,564,547],{}," are written as objects here:",[397,567,568,577],{},[400,569,570],{},[403,571,572,575],{},[406,573,574],{},"Property",[406,576,411],{},[413,578,579,609,629],{},[403,580,581,585],{},[418,582,583],{},[28,584,37],{},[418,586,587,38,590,593,594,597,598,562,601,604,605,608],{},[28,588,589],{},"[\"lower\"]",[28,591,592],{},"[\"upper\"]",", or both: whole-word casings that always pass (",[28,595,596],{},"tech"," sets both so ",[28,599,600],{},"github",[28,602,603],{},"GITHUB"," pass while ",[28,606,607],{},"Github"," fails).",[403,610,611,615],{},[418,612,613],{},[28,614,550],{},[418,616,617,618,621,622,624,625,628],{},"Locale forms such as ",[28,619,620],{},"{ de: [\"Dockingstation\", \"Dockingstationen\"] }",", passed to ",[24,623,342],{"href":341}," and matched by ",[28,626,627],{},"glosslint explain",".",[403,630,631,635],{},[418,632,633],{},[28,634,547],{},[418,636,637,638,621,641,628],{},"Locale translations such as ",[28,639,640],{},"{ de: \"Dock\" }",[24,642,342],{"href":341},[20,644,645,646,648,649,562,652,655,656,289],{},"In ",[28,647,30],{}," they are the ",[28,650,651],{},"Forms",[28,653,654],{},"Translations"," fields (",[24,657,659],{"href":658},"\u002Fguide\u002Fglossary#translations-and-forms","Translations and forms",[291,661,468],{"id":662,"anchor":663},"allowing-phrases",{"label":664,"icon":296},"Section titled \"Allowing phrases\"",[20,666,667,668,382,670,673,674,382,677,680,681,382,684,687],{},"Findings inside an ",[28,669,461],{},[28,671,672],{},"Allow:"," phrase are dropped. Use it for second meanings like ",[28,675,676],{},"\"roof rack\"",[28,678,679],{},"\"check out our\"",", or to silence a preset term. Words match in any case, across spaces, hyphens, and underscores, and with ",[28,682,683],{},"s",[28,685,686],{},"es"," plurals.",[291,689,440],{"id":690,"anchor":691},"merge-order",{"label":692,"icon":296},"Section titled \"Merge order\"",[20,694,695,696,562,699,702],{},"Terms merge by key: words joined and lowercased, letters and digits only (",[28,697,698],{},"\"Re-charge point\"",[28,700,701],{},"\"recharge point\""," share a key).",[704,705,706,711,727,730,738],"ol",{},[305,707,708,710],{},[28,709,422],{}," merges left to right; later corpora replace earlier terms with the same key.",[305,712,713,714,716,717,719,720,319,723,726],{},"Your own ",[28,715,447],{}," replace matching keys from ",[28,718,422],{},". Duplicate keys throw ",[28,721,722],{},"GLOSSLINT_C005",[28,724,725],{},"GLOSSLINT_G005"," in Markdown).",[305,728,729],{},"Replacement is whole; fields do not merge.",[305,731,732,734,735,737],{},[28,733,461],{}," lists concatenate, ",[28,736,422],{}," first, then yours.",[305,739,740,742,743,38,746,38,749,752,753,755],{},[28,741,475],{}," merges per kind (",[28,744,745],{},"label",[28,747,748],{},"header",[28,750,751],{},"sentence","), last wins; ",[28,754,41],{}," takes the last defined boolean.",[757,759,760,761,762],{"id":293,"depth":758,"text":297},2,{"id":392,"depth":758,"text":395},{"id":509,"depth":758,"text":512},{"id":662,"depth":758,"text":468},{"id":690,"depth":758,"text":440},{"path":26,"title":764,"description":765},"glossary.md","Define your project's vocabulary in .agents\u002Fglossary.md with preferred terms, words to avoid, casing rules, and examples.",{"path":488,"title":489,"description":767},"Pick exact, spelling, or context casing per term, see how glosslint tells labels from sentences, and set case styles per kind of text.",1795952941382,"f20d75f8-66fe-45da-ad80-3ee49bbc9209"]