This document covers use of the VS Code extension
streetsidesoftware.code-spell-checker.
It is intentionally separate from codespell, which is the spell checker used
by commit hooks and GitHub Actions.
The VS Code spell checker can use a repository-stored configuration file and a
repository-stored custom dictionary file that are separate from the dictionary
or ignore-word files used by codespell in commit hooks and CI.
Recommended pattern:
- Use a repo
cspellconfig file for IDE spell checking. - Use a separate repo text file for IDE-specific accepted words.
- Keep
codespellignore words and config separate for hooks and CI. - Do not rely on user-global settings or
.vscode/settings.jsonfor project training.
These are different tools:
- VS Code extension:
streetsidesoftware.code-spell-checker - Underlying config format for that extension:
cspell - Commit hook / CI tool:
codespell
They do not use the same dictionary format and do not read the same config files by default.
That means a repo cspell.json or cspell.config.yaml file can be committed
for IDE use without changing codespell behavior in hooks or GitHub Actions.
The Code Spell Checker extension is designed to catch unknown words in general text and code comments. It often needs project-specific training for:
- product names
- repository names
- acronyms
- internal abbreviations
- domain-specific terms
codespell behaves differently. It uses curated typo dictionaries and is better
at catching common misspellings with fewer project-training changes.
Because of that difference, it is reasonable to keep:
- a
codespellallowlist for hook and CI false positives - a separate
cspellproject dictionary for IDE comfort
Suggested files:
cspell.config.yamlvscode-project-words.txt
Example purpose of each file:
cspell.config.yaml: project-level config for the VS Code extensionvscode-project-words.txt: accepted words for IDE spell checking
A root cspell.config.yaml file is the cleanest option because the VS Code
extension can discover it automatically in the repository.
Example:
version: '0.2'
language: en
useGitignore: true
words: []
dictionaryDefinitions:
- name: project-words
path: ./vscode-project-words.txt
addWords: true
scope: workspace
dictionaries:
- project-words
ignorePaths:
- .git/**
- .venv/**
- node_modules/**Example dictionary file:
ansible-lab
codespell
groovylint
shellcheck
With that pattern:
- the VS Code extension gets a project dictionary from the repository
- the dictionary file is separate from
codespellhook configuration - user-global spell checker state is not required
- project-specific training can be reviewed like normal source changes
Preferred order:
- If the word is a real project term used broadly, add it to the repo
vscode-project-words.txtfile. - If the word is specific to one file, use an inline
cSpell:ignoreorcSpell:wordscomment. - If the word is personal or not appropriate for the repository, keep it in the user's own global dictionary instead of committing it.
In VS Code, right-click on a misspelled word (the squiggly underline) in the editor and choose one of these:
- Add to Workspace Dictionary: writes the word to
vscode-project-words.txtbased oncspell.config.yamldictionaryDefinitions. - Add to Workspace Settings: writes the word into
.vscode/settings.json(cSpell.words) for this workspace that will remain private your workspace directory. - Add to User Settings: writes the word into your personal VS Code user settings that will be global to all you VS Code use only.
Expand for details about inconsistent right-click handling for adding words.
If the misspelled word currently has editor focus (cursor is on it or it is selected), right-clicking it may open a confirmation dialog at the top of the editor rather than adding the word immediately. You must press Enter in that dialog to confirm. If the dialog is overlooked and you click elsewhere, the addition is silently discarded. To avoid this, first click somewhere else in the editor to move focus away from the word, then right-click the squiggly underline. This adds the word in one step with no confirmation dialog.
Recommended team workflow:
- Use Add to Workspace Dictionary for stable, project-wide terms.
- Review and commit updates in
vscode-project-words.txt. - Use Add to Workspace Settings only for temporary local exceptions.
- Use Add to User Settings only for personal preferences.
Manual edit workflow:
- Open
vscode-project-words.txtin the repository root. - Add one accepted word per line.
- Save the file; VS Code cspell diagnostics update automatically.
- Commit the change when the term is broadly applicable to the project.
Examples:
JavaScript / TypeScript / many code files:
// cSpell:ignore myspecialtoken
// cSpell:words repoSpecificTerm
Markdown:
<!-- cSpell:ignore myspecialtoken -->Avoid these patterns for project training:
- storing project spell-check training only in VS Code user settings
- storing project spell-check training only in
.vscode/settings.json - mixing
cspellproject words intocodespellignore-word files
Those approaches either make the setup non-portable or blur the distinction between the IDE checker and the hook/CI checker.
codespell uses its own configuration and allowlist mechanisms, such as:
.codespellrcsetup.cfgpyproject.tomlcodespell -I <file>ignore-word files
A cspell.config.yaml or cspell.json file does not replace those and does not
change codespell behavior unless you explicitly wire the two together.
That separation is useful here.
Recommended baseline:
- Commit a repo-level
cspellconfig for IDE use. - Commit a repo-level
vscode-project-words.txtfile for IDE-only accepted terms. - Keep
codespellhook and CI configuration separate. - Only add stable, broadly used terms to the repo IDE dictionary.
- Keep user-specific or temporary words out of the repository.
This document only covers repository-managed spell-check behavior for the VS Code extension.
It does not attempt to standardize:
- a user's personal global dictionary
- local site policy for extension installation
- local AI policy or compliance requirements
- editor settings unrelated to spell checking
This repository currently uses:
cspell.config.yamlvscode-project-words.txt- separate
codespellconfiguration for hooks and CI