eng/common/spelling/README.md
This directory contains a script to run cspell (Code Spell Checker) on the repository using the dependencies defined in the adjacent package*.json files.
If the spell checker flags legitimate words as misspelled, you can add them to the dictionary configuration file located at .vscode/cspell.json.
There are two main places to add legitimate words. Maintain alphabetical order when adding words to keep the dictionary organized:
Root-level words array: Add words to the "words" array at the root level of the configuration file. This is the preferred location for project-specific terms, technical vocabulary, and commonly used words.
Baseline dictionary: Add words to the "baseline" dictionary under "dictionaryDefinitions". This is typically used for words that were already present in the codebase when the spell checker was first introduced.
To add new words, edit .vscode/cspell.json and add them to the "words" array:
{
"words": [
"myprojectname",
"customterm",
"technicalword"
]
}
Invoke-Cspell.ps1# Check all files (default)
./eng/common/spelling/Invoke-Cspell.ps1
# Check specific files
./eng/common/spelling/Invoke-Cspell.ps1 -ScanGlobs 'sdk/*/*/PublicAPI/**/*.md'
# Check multiple globs (powershell invocation only)
./eng/common/spelling/Invoke-Cspell.ps1 -ScanGlobs @('sdk/storage/**', 'sdk/keyvault/**')
# Check single file
./eng/common/spelling/Invoke-Cspell.ps1 -ScanGlobs './README.md'
lint).vscode/cspell.json configuration file must existjq command-line JSON processor (for bash version)package.json and package-lock.json to the working directorynpm ciThe scripts ensure that a LICENSE file (or temporary file) is always included in the scan to meet cspell's requirements for the "files" array.