glosslint
glosslint

Lint product terms in Vue, TypeScript and @nuxtjs/i18n locale files against a glossary, through @nuxt/eslint.

glosslint

npm version npm downloads CI license: MIT

docs

glosslint checks your product's vocabulary against one Markdown file, .agents/glossary.md. People and coding agents read that file directly, while ESLint, Oxlint, x18n and the CLI enforce it on code, source-locale messages and docs. Translated messages aren't checked: toX18nGlossary hands the terms, with any translations and forms, to x18n's glossary for translators, and glosslint export --diglot <locale> writes a locale's decisions, accepted forms and hints into its diglot glossary. Every finding carries the reason and meaning alongside the fix.

Docs · Installation · The glossary file · ESLint · Oxlint · x18n · CLI · For agents

The glossary

Write your product's terms in .agents/glossary.md. This excerpt comes from the bike-share app in examples/basic/.agents/glossary.md:

# Glossary

<!-- Format and checks: https://glosslint.loadsheet.dev/guide/glossary -->

The words the rider app and the help center use.

Presets: tech, inclusive
Allow: check out our, roof rack

## Dock
What: A powered stand where one bike is locked.
How: A station is a group of docks.
Avoid:
- rack: Racks are unpowered.
- bay
Good:
- Return the bike to any dock
Bad:
- Return the bike to any rack
Links:
- [Docks](https://example.com/docs/docks)

## eBike

## Day Pass (DP)
Case: context

eBike gets Case: exact automatically because of its inner capital. Day Pass (DP) sets the abbreviation DP and enforces Title Case in labels and lowercase in sentences. Every runner reads .agents/glossary.md by default. When you need fields such as skip or wholeLabel, build a corpus with defineCorpus and pass it to the runner: glosslint({ corpus }) in ESLint or x18n, --corpus <module> in the CLI.

Install

pnpm add -D glosslint

glosslint requires Node 22.18 or later. ESLint (>=9.15.0), Oxlint (>=1.94.0) and @x18n/core (>=0.1.14) are optional peer dependencies. Install only the ones you use.

One finding

Run the CLI on Markdown docs:

npx glosslint check docs/guide

Here is one finding from examples/basic:

[GLOSSLINT_AVOID] "rack" in docs/guide/riding.md:3:56
├▶ why: Racks are unpowered.
├▶ fix: Use "dock": "Unlock a bike at any station, then return it to a free dock when you finish."
├▶ term: Dock, a powered stand where one bike is locked.
╰▶ see: https://example.com/docs/docks

Where it checks

  • ESLint: glosslint() reads .agents/glossary.md with no options and checks strings, comments and identifiers in JavaScript, TypeScript and Vue templates, plus YAML and JSON locale values.
  • Nuxt and vue-i18n: add "glosslint/nuxt" to modules and eslint . lints Vue, TypeScript and the @nuxtjs/i18n source locale through @nuxt/eslint. It also checks the glossary when Nuxt starts.
  • Oxlint: add "glosslint/oxlint" to jsPlugins in .oxlintrc.json to run the four rules on JavaScript, TypeScript and Vue <script> blocks (Oxlint JS plugins are alpha).
  • x18n: check source-locale messages and hard-coded strings, and pass the corpus to toX18nGlossary for x18n's glossary.
  • CLI: checks Markdown, MDX and text files and fixes them with --fix, tests term examples, prints corpora and explains words from the terminal.

Doctor

glosslint doctor checks .agents/glossary.md for format mistakes, bad values, duplicate terms and failing Good/Bad examples. Pass --fix to rewrite fixable layout, heading and field-name issues into canonical form without dropping text:

npx glosslint doctor --fix

For agents

Coding agents read .agents/glossary.md directly, so link it from AGENTS.md. When an agent is unsure which word to use, glosslint explain "<word>" prints the term, its meaning, its usage notes and the words to avoid. For agents covers the editing loop by fix.kind.

License

MIT. The tech preset includes data from case-police, also MIT. See NOTICE.