[{"data":1,"prerenderedAt":838,"buildId":839},["ShallowReactive",2],{"docs:\u002Fguide\u002Finstallation":3},{"page":4,"section":16,"document":17,"credits":10,"prev":832,"next":836},{"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},"installation","\u002Fguide\u002Finstallation","guide\u002Finstallation.md","Installation","Install glosslint, check the Node 22.18 and optional peer requirements, write your first glosslint.config.ts, and run check and test.",null,[],"i-lucide-download","article",true,2,"guide",{"nodes":18,"toc":820},[19,28,36,43,139,145,159,166,172,175,532,538,566,581,721,724,748,766,772],[20,21,22,23,27],"p",{},"This page walks you through installing glosslint, checking its runtime and peer requirements, writing a small ",[24,25,26],"code",{},"glosslint.config.ts",", and running the CLI for the first time.",[29,30,35],"h2",{"id":31,"anchor":32},"install-the-package",{"label":33,"icon":34},"Section titled \"Install the package\"","#","Install the package",[20,37,38,39,42],{},"Install ",[24,40,41],{},"glosslint"," as a dev dependency with your package manager.",[44,45,55,87,105,122],"tabs",{"uid":46,"count":47,"labels":48,"code":53,"magic":54},"ct-bil0lf-1","4",[49,50,51,52],"pnpm","npm","yarn","bun","true","auto",[56,57,59],"tabs-item",{"label":49,"index":58},"1",[60,61,65],"pre",{"language":62,"frame":63,"class":64},"sh","terminal","shiki shiki-themes github-light-default github-dark-default dark:github-dark-default",[24,66,68],{"class":67},"language-sh",[69,70,73,76,80,84],"span",{"class":71,"style":72},"line","display: inline",[69,74,49],{"style":75},"color:#953800;--shiki-dark:#FFA657",[69,77,79],{"style":78},"color:#0A3069;--shiki-dark:#A5D6FF"," add",[69,81,83],{"style":82},"color:#0550AE;--shiki-dark:#79C0FF"," -D",[69,85,86],{"style":78}," glosslint",[56,88,90],{"label":50,"index":89},"2",[60,91,92],{"language":62,"frame":63,"class":64},[24,93,94],{"class":67},[69,95,96,98,101,103],{"class":71,"style":72},[69,97,50],{"style":75},[69,99,100],{"style":78}," install",[69,102,83],{"style":82},[69,104,86],{"style":78},[56,106,108],{"label":51,"index":107},"3",[60,109,110],{"language":62,"frame":63,"class":64},[24,111,112],{"class":67},[69,113,114,116,118,120],{"class":71,"style":72},[69,115,51],{"style":75},[69,117,79],{"style":78},[69,119,83],{"style":82},[69,121,86],{"style":78},[56,123,124],{"label":52,"index":47},[60,125,126],{"language":62,"frame":63,"class":64},[24,127,128],{"class":67},[69,129,130,132,134,137],{"class":71,"style":72},[69,131,52],{"style":75},[69,133,79],{"style":78},[69,135,136],{"style":82}," -d",[69,138,86],{"style":78},[29,140,144],{"id":141,"anchor":142},"requirements",{"label":143,"icon":34},"Section titled \"Requirements\"","Requirements",[20,146,147,148,150,151,154,155,158],{},"glosslint needs Node 22.18 or later, because it loads ",[24,149,26],{}," with Node's own ",[24,152,153],{},"import()"," and type stripping. You do not need a bundler or TypeScript loader to run the CLI against a ",[24,156,157],{},".ts"," config file.",[20,160,161,162,165],{},"ESLint 9.15 or later and ",[24,163,164],{},"@x18n\u002Fcore"," are optional peer dependencies. Install only the ones you use. If you only run the CLI on Markdown docs, you need neither peer.",[29,167,171],{"id":168,"anchor":169},"first-setup",{"label":170,"icon":34},"Section titled \"First setup\"","First setup",[20,173,174],{},"Create a corpus file at the root of your repository, then run the CLI to check your docs and test your term examples.",[176,177,178,417,484],"steps",{},[179,180,181,190,212,401],"step",{"index":58},[182,183,187,188],"h3",{"id":184,"anchor":185},"write-glosslintconfigts",{"label":186,"icon":34},"Section titled \"Write glosslint.config.ts\"","Write ",[24,189,26],{},[20,191,192,193,195,196,199,200,203,204,207,208,211],{},"Create ",[24,194,26],{}," at the project root. This starter corpus defines two terms from the bike-share app, ",[24,197,198],{},"Dock"," and ",[24,201,202],{},"eBike",", and allows ",[24,205,206],{},"\"roof rack\""," so that second meaning of ",[24,209,210],{},"rack"," is never reported.",[60,213,215],{"language":214,"filename":26,"class":64},"ts",[24,216,218,237,238,237,240,237,255,237,260,237,265,237,276,237,286,237,296,237,319,237,336,237,353,237,358,237,375,237,382,237,394],{"class":217},"language-ts",[69,219,220,224,228,231,234],{"class":71,"style":72},[69,221,223],{"style":222},"color:#CF222E;--shiki-dark:#FF7B72","import",[69,225,227],{"style":226},"color:#1F2328;--shiki-dark:#E6EDF3"," { defineCorpus } ",[69,229,230],{"style":222},"from",[69,232,233],{"style":78}," \"glosslint\"",[69,235,236],{"style":226},";","\n",[69,239],{"class":71,"style":72},[69,241,242,245,248,252],{"class":71,"style":72},[69,243,244],{"style":222},"export",[69,246,247],{"style":222}," default",[69,249,251],{"style":250},"color:#8250DF;--shiki-dark:#D2A8FF"," defineCorpus",[69,253,254],{"style":75},"({",[69,256,257],{"class":71,"style":72},[69,258,259],{"style":226},"  terms: [",[69,261,262],{"class":71,"style":72},[69,263,264],{"style":226},"    {",[69,266,267,270,273],{"class":71,"style":72},[69,268,269],{"style":226},"      term: ",[69,271,272],{"style":78},"\"Dock\"",[69,274,275],{"style":226},",",[69,277,278,281,284],{"class":71,"style":72},[69,279,280],{"style":226},"      description: ",[69,282,283],{"style":78},"\"A powered stand where one bike is locked.\"",[69,285,275],{"style":226},[69,287,288,291,294],{"class":71,"style":72},[69,289,290],{"style":226},"      nuance: ",[69,292,293],{"style":78},"\"A station is a group of docks.\"",[69,295,275],{"style":226},[69,297,298,301,304,307,310,313,316],{"class":71,"style":72},[69,299,300],{"style":226},"      avoid: [{ word: ",[69,302,303],{"style":78},"\"rack\"",[69,305,306],{"style":226},", why: ",[69,308,309],{"style":78},"\"Racks are unpowered.\"",[69,311,312],{"style":226}," }, ",[69,314,315],{"style":78},"\"bay\"",[69,317,318],{"style":226},"],",[69,320,321,324,327,330,333],{"class":71,"style":72},[69,322,323],{"style":226},"      examples: { good: [",[69,325,326],{"style":78},"\"Return the bike to any dock\"",[69,328,329],{"style":226},"], bad: [",[69,331,332],{"style":78},"\"Return the bike to any rack\"",[69,334,335],{"style":226},"] },",[69,337,338,341,344,347,350],{"class":71,"style":72},[69,339,340],{"style":226},"      links: [{ title: ",[69,342,343],{"style":78},"\"Docks\"",[69,345,346],{"style":226},", url: ",[69,348,349],{"style":78},"\"https:\u002F\u002Fexample.com\u002Fdocs\u002Fdocks\"",[69,351,352],{"style":226}," }],",[69,354,355],{"class":71,"style":72},[69,356,357],{"style":226},"    },",[69,359,360,363,366,369,372],{"class":71,"style":72},[69,361,362],{"style":226},"    { term: ",[69,364,365],{"style":78},"\"eBike\"",[69,367,368],{"style":226},", case: ",[69,370,371],{"style":78},"\"exact\"",[69,373,374],{"style":226}," },",[69,376,377,380],{"class":71,"style":72},[69,378,379],{"style":226},"  ]",[69,381,275],{"style":75},[69,383,384,387,389,392],{"class":71,"style":72},[69,385,386],{"style":226},"  allow: [",[69,388,206],{"style":78},[69,390,391],{"style":226},"]",[69,393,275],{"style":75},[69,395,396,399],{"class":71,"style":72},[69,397,398],{"style":75},"})",[69,400,236],{"style":226},[20,402,403,406,407,410,411,416],{},[24,404,405],{},"defineCorpus"," checks every field when the config loads and throws a ",[24,408,409],{},"GlosslintConfigError"," on a mistake, as listed in ",[412,413,415],"a",{"href":414},"\u002Freference\u002Fconfig-errors","Config errors",". It returns a flat corpus that ESLint, x18n and the CLI all read.",[179,418,419,425,432,449],{"index":89},[182,420,424],{"id":421,"anchor":422},"check-your-markdown-docs",{"label":423,"icon":34},"Section titled \"Check your Markdown docs\"","Check your Markdown docs",[20,426,427,428,431],{},"Run ",[24,429,430],{},"glosslint check"," on your docs folder:",[60,433,434],{"language":62,"frame":63,"class":64},[24,435,436],{"class":67},[69,437,438,441,443,446],{"class":71,"style":72},[69,439,440],{"style":75},"npx",[69,442,86],{"style":78},[69,444,445],{"style":78}," check",[69,447,448],{"style":78}," docs",[20,450,451,452,455,456,459,460,199,463,466,467,199,470,473,474,477,478,480,481,483],{},"In a folder, ",[24,453,454],{},"check"," reads ",[24,457,458],{},".md",", ",[24,461,462],{},".mdx",[24,464,465],{},".txt"," files while skipping ",[24,468,469],{},"node_modules",[24,471,472],{},".git",". In Markdown it skips frontmatter, fenced and inline code, HTML comments and tags, link targets and reference definitions. It exits ",[24,475,476],{},"0"," when there are no findings, ",[24,479,58],{}," when it finds something, and ",[24,482,89],{}," when the config or command line is wrong.",[179,485,486,492,502,515],{"index":107},[182,487,491],{"id":488,"anchor":489},"test-your-corpus-examples",{"label":490,"icon":34},"Section titled \"Test your corpus examples\"","Test your corpus examples",[20,493,427,494,497,498,501],{},[24,495,496],{},"glosslint test"," to verify every term's ",[24,499,500],{},"examples",":",[60,503,504],{"language":62,"frame":63,"class":64},[24,505,506],{"class":67},[69,507,508,510,512],{"class":71,"style":72},[69,509,440],{"style":75},[69,511,86],{"style":78},[69,513,514],{"style":78}," test",[20,516,517,518,521,522,525,526,528,529,531],{},"Every ",[24,519,520],{},"good"," string must pass, and every ",[24,523,524],{},"bad"," string must produce a finding for that term. Run ",[24,527,496],{}," in CI and whenever you edit ",[24,530,26],{},".",[29,533,537],{"id":534,"anchor":535},"example-output",{"label":536,"icon":34},"Section titled \"Example output\"","Example output",[20,539,540,541,547,548,459,551,554,555,557,558,561,562,565],{},"To see all three finding codes together, ",[412,542,544],{"href":543},"https:\u002F\u002Fgithub.com\u002Fonmax\u002Fglosslint\u002Fblob\u002Fmain\u002Fexamples\u002Fbasic",[24,545,546],{},"examples\u002Fbasic"," extends this setup with ",[24,549,550],{},"Checkout",[24,552,553],{},"Day Pass",", a Markdown glossary table, and the tech and inclusive presets. Running ",[24,556,454],{}," on ",[24,559,560],{},"docs\u002Fguide"," skips ",[24,563,564],{},"docs\u002Fglossary.md",", whose avoid column would report itself, and prints:",[60,567,568],{"language":62,"frame":63,"class":64},[24,569,570],{"class":67},[69,571,572,574,576,578],{"class":71,"style":72},[69,573,440],{"style":75},[69,575,86],{"style":78},[69,577,445],{"style":78},[69,579,580],{"style":78}," docs\u002Fguide",[60,582,584],{"language":583,"class":64},"txt",[24,585,587,237,592,237,597,237,602,237,607,237,612,237,617,237,621,237,625,237,630,237,635,237,640,237,644,237,649,237,654,237,659,237,664,237,668,237,673,237,678,237,683,237,688,237,693,237,697,237,702,237,707,237,712,237,716],{"class":586},"language-txt",[69,588,589],{"class":71,"style":72},[69,590,591],{},"[GLOSSLINT_CASE] \"day pass\" in docs\u002Fguide\u002Fpasses.md:1:12",[69,593,594],{"class":71,"style":72},[69,595,596],{},"├▶ fix: Change to \"Day Pass\": \"# Buying a Day Pass\"",[69,598,599],{"class":71,"style":72},[69,600,601],{},"╰▶ term: Day Pass",[69,603,604],{"class":71,"style":72},[69,605,606],{},"",[69,608,609],{"class":71,"style":72},[69,610,611],{},"[GLOSSLINT_CASE] \"Day Pass\" in docs\u002Fguide\u002Fpasses.md:3:7",[69,613,614],{"class":71,"style":72},[69,615,616],{},"├▶ fix: Change to \"day pass\": \"Buy a day pass at the kiosk, or pay with Apple pay in the app.\"",[69,618,619],{"class":71,"style":72},[69,620,601],{},[69,622,623],{"class":71,"style":72},[69,624,606],{},[69,626,627],{"class":71,"style":72},[69,628,629],{},"[GLOSSLINT_CASE] \"Apple pay\" in docs\u002Fguide\u002Fpasses.md:3:42",[69,631,632],{"class":71,"style":72},[69,633,634],{},"├▶ fix: Change to \"Apple Pay\": \"Buy a Day Pass at the kiosk, or pay with Apple Pay in the app.\"",[69,636,637],{"class":71,"style":72},[69,638,639],{},"╰▶ term: Apple Pay",[69,641,642],{"class":71,"style":72},[69,643,606],{},[69,645,646],{"class":71,"style":72},[69,647,648],{},"[GLOSSLINT_AVOID] \"Manned\" in docs\u002Fguide\u002Fpasses.md:4:1",[69,650,651],{"class":71,"style":72},[69,652,653],{},"├▶ why: It assumes the people on duty are men.",[69,655,656],{"class":71,"style":72},[69,657,658],{},"├▶ fix: Use \"Staffed\": \"Staffed stations sell passes from 7:00 to 19:00.\"",[69,660,661],{"class":71,"style":72},[69,662,663],{},"╰▶ term: staffed, having people on duty.",[69,665,666],{"class":71,"style":72},[69,667,606],{},[69,669,670],{"class":71,"style":72},[69,671,672],{},"[GLOSSLINT_AVOID] \"rack\" in docs\u002Fguide\u002Friding.md:3:56",[69,674,675],{"class":71,"style":72},[69,676,677],{},"├▶ why: Racks are unpowered.",[69,679,680],{"class":71,"style":72},[69,681,682],{},"├▶ fix: Use \"dock\": \"Unlock a bike at any station, then return it to a free dock when you finish.\"",[69,684,685],{"class":71,"style":72},[69,686,687],{},"├▶ term: Dock, a powered stand where one bike is locked.",[69,689,690],{"class":71,"style":72},[69,691,692],{},"╰▶ see: https:\u002F\u002Fexample.com\u002Fdocs\u002Fdocks",[69,694,695],{"class":71,"style":72},[69,696,606],{},[69,698,699],{"class":71,"style":72},[69,700,701],{},"[GLOSSLINT_TERM] \"e-bike\" in docs\u002Fguide\u002Friding.md:4:15",[69,703,704],{"class":71,"style":72},[69,705,706],{},"├▶ fix: Change to \"eBike\": \"Check out our eBike fleet if the hill feels long.\"",[69,708,709],{"class":71,"style":72},[69,710,711],{},"╰▶ term: eBike",[69,713,714],{"class":71,"style":72},[69,715,606],{},[69,717,718],{"class":71,"style":72},[69,719,720],{},"6 findings in 2 of 2 files.",[20,722,723],{},"And testing that corpus prints each tested term and a summary count:",[60,725,726],{"language":62,"frame":63,"class":64},[24,727,728],{"class":67},[69,729,730,732,734,736,739,742,745],{"class":71,"style":72},[69,731,440],{"style":75},[69,733,86],{"style":78},[69,735,514],{"style":78},[69,737,738],{"style":222}," |",[69,740,741],{"style":75}," tail",[69,743,744],{"style":82}," -n",[69,746,747],{"style":82}," 3",[60,749,750],{"language":583,"class":64},[24,751,752,237,757,237,761],{"class":586},[69,753,754],{"class":71,"style":72},[69,755,756],{},"✓ Dock                    1 good, 1 bad",[69,758,759],{"class":71,"style":72},[69,760,606],{},[69,762,763],{"class":71,"style":72},[69,764,765],{},"38 terms, 0 failing.",[29,767,771],{"id":768,"anchor":769},"next",{"label":770,"icon":34},"Section titled \"Next\"","Next",[773,774,775,787,794,801],"ul",{},[776,777,778,782,783,786],"li",{},[412,779,781],{"href":780},"\u002Fguide\u002Fcorpus","The corpus",": add presets, load a Markdown glossary table, and configure casing and ",[24,784,785],{},"allow"," lists.",[776,788,789,793],{},[412,790,792],{"href":791},"\u002Fintegrations\u002Feslint","ESLint",": lint strings, Vue templates, YAML locales, comments and identifiers in your codebase.",[776,795,796,800],{},[412,797,799],{"href":798},"\u002Fintegrations\u002Fx18n","x18n",": check source locale messages and share your corpus with x18n's glossary.",[776,802,803,807,808,459,810,459,813,199,816,819],{},[412,804,806],{"href":805},"\u002Fintegrations\u002Fcli","CLI",": explore ",[24,809,454],{},[24,811,812],{},"test",[24,814,815],{},"print",[24,817,818],{},"explain",", plus flags and exit codes.",[821,822,823,830,831],{"id":31,"depth":15,"text":35},{"id":141,"depth":15,"text":144},{"id":168,"depth":15,"text":171,"children":824},[825,828,829],{"id":184,"depth":826,"text":827},3,"Write glosslint.config.ts",{"id":421,"depth":826,"text":424},{"id":488,"depth":826,"text":491},{"id":534,"depth":15,"text":537},{"id":768,"depth":15,"text":771},{"path":833,"title":834,"description":835},"\u002Fguide","Introduction","Learn how glosslint checks product terms across ESLint, x18n and Markdown docs from one glossary, and what its three finding codes report.",{"path":780,"title":781,"description":837},"Define your glosslint corpus in glosslint.config.ts, combine presets and glossary tables, allow phrases, and control merge order.",1795627929734,"94d466e2-147b-430f-b5f0-25c6a986e462"]