script-utils/linters/cspell
This module provides a function for running a spellcheck on the codebase using the cspell library. It reports any spelling issues found in the code and returns a CliTaskResult indicating whether the spellcheck was successful.
Interfaces
Section titled “Interfaces”| Interface | Description |
|---|---|
| SpellcheckOptions | Parameters for the spellcheck function. |
Functions
Section titled “Functions”| Function | Description |
|---|---|
| spellcheck | Runs a spellcheck on the entire codebase using cspell. Checks all files in the current folder and its subfolders for spelling issues. If issues are found, they are logged to the console with their file path, line, and column number. Uses --no-must-find-files so that cspell does not fail when all provided paths are excluded by built-in ignore rules (e.g., package-lock.json). Uses --gitignore so a path git ignores is a path cspell skips — generated output, build folders and every node_modules are covered without a hand-maintained ignorePaths list that drifts from .gitignore. It is passed on the command line rather than set in cspell.json so that every project consuming this function inherits it, rather than each having to edit its own config. --gitignore-root stops the search at the project root, so a .gitignore in some parent folder outside the project cannot silently remove files from the check. |