Problem
In large repositories, generated or vendored files (e.g. dist/, node_modules/, *.min.js, lock files) produce thousands of false-positive spell-check errors. These files are already listed in .gitignore, but the spell checker does not consult .gitignore by default — users must duplicate the ignore patterns in cspell.json or VS Code settings.
This creates two problems:
- Maintenance burden: when
.gitignore is updated, cspell.ignorePaths must also be updated.
- Discovery: new contributors don't know they need to add
cspell.ignorePaths and are confused by squiggles in generated files.
What CSpell CLI Already Supports
The cspell CLI (v6+) supports --use-gitignore / useGitignore: true in cspell.json. The VS Code extension does not expose this as a configurable setting and does not enable it by default.
Proposed Change
- Add
cspell.useGitignore (boolean, default false) to package.json contributes.configuration.
- Pass it through to the cspell language server's initialization options.
- When
true, the server reads .gitignore files up the directory tree and skips matching files.
- Document it prominently in the README under "Performance" and "Large Repositories".
Why Default false
Keeps existing behaviour for users who don't have a .gitignore or who intentionally spell-check vendored code.
Related
Environment
- VS Code: 1.89+, monorepo with 50k+ files
- Extension: streetsidesoftware.code-spell-checker latest
Problem
In large repositories, generated or vendored files (e.g.
dist/,node_modules/,*.min.js, lock files) produce thousands of false-positive spell-check errors. These files are already listed in.gitignore, but the spell checker does not consult.gitignoreby default — users must duplicate the ignore patterns incspell.jsonor VS Code settings.This creates two problems:
.gitignoreis updated,cspell.ignorePathsmust also be updated.cspell.ignorePathsand are confused by squiggles in generated files.What CSpell CLI Already Supports
The
cspellCLI (v6+) supports--use-gitignore/useGitignore: trueincspell.json. The VS Code extension does not expose this as a configurable setting and does not enable it by default.Proposed Change
cspell.useGitignore(boolean, defaultfalse) topackage.jsoncontributes.configuration.true, the server reads.gitignorefiles up the directory tree and skips matching files.Why Default
falseKeeps existing behaviour for users who don't have a
.gitignoreor who intentionally spell-check vendored code.Related
--use-gitignore(exists since v6)${env:...}variables in dictionary paths) is adjacent — both reduce manual path duplication.Environment