glosslint checks the words people read, not code syntax, identifiers inside strings, or markup. Knowing what gets skipped helps you predict when a term will be flagged and when you need to add a phrase to allow in your corpus.
Text never read as words anywhere
Section titled "Text never read as words anywhere"Before matching any string in ESLint, x18n, or the CLI, glosslint blanks out spans that are code rather than words:
{placeholders}and{{ mustaches }}- ICU syntax, while still reading the words inside ICU branches
- URLs and email addresses
- file paths
- text in backticks
camelCase,snake_case, andkebab-slugtokens
Two rules keep real words from disappearing:
- A token that is an
exactterm or abbreviation itself stays, soeBikeis still checked. - The
sof a possessive never forms a word, so"the Dock's light"does not read"s".
For example, with rack as an avoid word for Dock and eBike as an exact term:
"Check {rack} availability at https://example.com/rack."produces no findings. Both{rack}and the URL are blanked before matching."Return your e-bike to {rack} at https://example.com/rack."reports"e-bike"as"eBike"and still skips{rack}and the URL.
What ESLint skips in code
Section titled "What ESLint skips in code"When linting JavaScript, TypeScript, Vue templates, and YAML files through ESLint, glosslint/term and glosslint/avoid skip strings that are code:
- Import and export sources, object and class keys, member names, and TypeScript literal types. A quoted object key with a space in it is text, so ESLint reads it.
- Operands of comparisons and
switchcases, directives such as"use strict", enum member names, and tagged templates. - The first argument of
t,$t,te,tm, and any callee matched byignoreCallees, which defaults toendsWith,startsWith,includes, andquerySelector*. - The Vue attributes
class,style,id,key,ref,name,to,href,src,icon,type,variant,color,size,slot,is,for, thearia-*attributes that hold ids (aria-labelledby,aria-describedby,aria-controls,aria-owns), and everydata-*attribute. - YAML keys. Only YAML string values are checked.
- Strings with no spaces shaped like code: all lowercase, kebab, snake, camelCase, or a path.
The ESLint rules also skip offering a fix when the source cannot take it as written. A string whose escapes the fix would break, or a YAML block scalar, still reports the finding without a fix.
In comments, glosslint/comment skips tool directives such as eslint-disable, @ts-expect-error, prettier-ignore, and #region. In identifiers, glosslint/identifier skips shorthand destructuring such as const { daypass } = response, because that name comes from somewhere else.
What the CLI skips in Markdown and MDX
Section titled "What the CLI skips in Markdown and MDX"When checking documentation with the CLI, glosslint check strips non-prose syntax before reading headings, table cells, paragraphs, and list items:
- In Markdown, it skips frontmatter, fenced and inline code, HTML comments and tags, link targets, and reference definitions.
- In MDX, it also skips
importandexportlines. - When given a folder, it reads
.md,.mdx, and.txtfiles and skipsnode_modulesand.git.
Tip
A Markdown table full of avoid words will report itself. Keep any file read by fromGlossaryTable out of the paths you pass to glosslint check. See Glossary table.