Use glosslint/oxlint to run glosslint's four rules inside Oxlint on JavaScript, TypeScript, and <script> blocks inside Vue files. It reads .agents/glossary.md from Oxlint's working directory on the first file and requires Oxlint 1.94 or later as an optional peer dependency.
Warning
JavaScript plugins in Oxlint 1.94 are alpha. The glosslint/oxlint entry point or .oxlintrc.json shape may change as Oxlint's JS plugin API evolves.
Add "glosslint/oxlint" to jsPlugins and enable the four rules in .oxlintrc.json:
{
"jsPlugins": ["glosslint/oxlint"],
"rules": {
"glosslint/term": "error",
"glosslint/avoid": "error",
"glosslint/comment": "error",
"glosslint/identifier": "warn"
}
}Run Oxlint as usual, and pass --fix to apply autofixes:
npx oxlint
npx oxlint --fixBecause Oxlint has no config hook that runs before the first file, the plugin reads .agents/glossary.md (or settings.glosslint.glossary) from context.cwd when the first file is linted and caches the corpus for the rest of the process.
Settings
Section titled "Settings"Configure the plugin under settings.glosslint in .oxlintrc.json:
{
"jsPlugins": ["glosslint/oxlint"],
"settings": {
"glosslint": {
"glossary": "docs/glossary.md",
"ignoreCallees": ["endsWith", "startsWith", "includes", "querySelector*"],
"identifierAvoid": false
}
},
"rules": {
"glosslint/term": "error",
"glosslint/avoid": "error",
"glosslint/comment": "error",
"glosslint/identifier": "warn"
}
}| Setting | Default | What it does |
|---|---|---|
glossary | ".agents/glossary.md" | Path to the glossary file, resolved from Oxlint's working directory. |
ignoreCallees | ["endsWith", "startsWith", "includes", "querySelector*"] | Functions whose first argument is never checked. A trailing * matches a prefix. Your list replaces the default. t, $t, te and tm are always skipped. |
identifierAvoid | false | Report avoid words in declared identifier names too. Off by default, because a rename touches every caller. |
Rules and fixes
Section titled "Rules and fixes"glosslint/oxlint exports the same four rules as ESLint and uses the same string, comment, and identifier skipping logic described in What glosslint skips:
| Rule | Reports | oxlint --fix |
|---|---|---|
glosslint/term | GLOSSLINT_TERM and GLOSSLINT_CASE in strings | Applies autofixes; leaves shape-guessed context suggestions alone |
glosslint/avoid | GLOSSLINT_AVOID in strings | Never autofixes (suggestions only) |
glosslint/comment | All three codes in JS/TS line and block comments | Applies spelling and casing autofixes; leaves avoid-word suggestions alone |
glosslint/identifier | How a declared name splits into words (and avoid words if identifierAvoid is true) | Never autofixes (the message names the rename) |
Limits compared to ESLint
Section titled "Limits compared to ESLint"Use ESLint instead of or alongside Oxlint when your project needs any of the following:
- Vue
<template>blocks. Oxlint lints<script>inside.vuefiles, not<template>, because Oxlint JS plugins do not expose Vue template parser services. - YAML locale files. Oxlint does not lint
.ymlor.yamlfiles. defineCorpusorkindOf. OxlintjsPluginsentries are module specifiers andsettingsare JSON, soglosslint/oxlinttakes a glossary file path only and cannot accept aCorpusobject or akindOfcallback.
Worked example
Section titled "Worked example"With the .oxlintrc.json above and the bike-share .agents/glossary.md, Oxlint checks these two files:
// Return the bike to any rack.
export const label = "Return your e-bike to any rack";
export const daypassTotal = 2;<template>
<!-- Not checked by Oxlint -->
<p>Start the check-out at the bay.</p>
</template>
<script setup lang="ts">
// Free the rack when the ride ends.
const title = "Return your e-bike to a dock";
const daypassCount = [title];
</script>Running oxlint reports the comment, string, avoid-word, and identifier findings in src/rides.ts and in the <script> block of src/ReturnCard.vue, while skipping <template>. Running oxlint --fix rewrites "e-bike" to "eBike" in both files and leaves "rack" and the daypassTotal / daypassCount warnings for a person to review.