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.
Import:
import { spellcheck } from 'obsidian-dev-utils/script-utils/linters/cspell';Signature:
function spellcheck(options: SpellcheckOptions | undefined): Promise<void>Parameters:
| Parameter | Type | Description |
|---|---|---|
options | SpellcheckOptions | undefined | The SpellcheckOptions. |
Returns: Promise<void> — A Promise that resolves to a CliTaskResult, indicating the success or failure of the spellcheck.
Links to this page: