npm cspell 10.3.5
v10.3.5

4 hours ago

Fixes

fix(cspell-lib): `shouldCheckDocument` honors the `forceCheck` option (#9303)

fix(cspell-lib): shouldCheckDocument honors the forceCheck option (#9303)

Summary

For users of the cspell-lib API:

  • shouldCheckDocument now honors forceCheck. It returns shouldCheck: true for a document excluded by ignorePaths, or disabled by overrides or languageSettings. Before, the option was accepted but ignored. DocumentValidator already worked this way.
  • SpellCheckFileOptions now declares forceCheck, so it can be passed to spellCheckDocument and spellCheckFile with type checking.

fix: `--force-check` checks the listed files even when `ignorePaths` or `files` would skip them (#9300)

fix: --force-check checks the listed files even when ignorePaths or files would skip them (#9300)

Summary

--force-check now checks every file given with --file or --file-list, as its help says. Before, some of those files were still skipped:

  • files matched by ignorePaths in the config;
  • files that don't match the files setting in the config.

Using globs on the command line together with --force-check is now an error, the same as globs with --file:

error: mixing globs and --force-check is not supported

Before, cspell lint --file-list list.txt "**/*.md" --force-check was accepted. To filter a file list by glob, leave out --force-check.


fix: `files` globs starting with `**` no longer skip `--file` and `--file-list` files in a project under a dot folder (#9299)

fix: files globs starting with ** no longer skip --file and --file-list files in a project under a dot folder (#9299)

Summary

When a project was under a folder whose name starts with a dot, such as ~/.local/src/my-project or a git worktree in .claude/worktrees/, files given with --file or --file-list could be skipped without any warning. CSpell then reported Files checked: 0 and exited with success.

This happened when the listed files were filtered by a glob starting with **:

  • from the files setting in the config, for --file and --file-list;
  • from globs on the command line, for --file-list, for example cspell lint --file-list changed-files.txt "**/*.md".

These files are now checked.

  • Files and folders inside the project whose names start with a dot are still left out unless --dot or enableGlobDot is set, as before.
  • Checking with globs alone (cspell lint "**/*.md") was not affected.

fix: Thai text and substitutions are checked and reported correctly (#9289)

fix: Thai text and substitutions are checked and reported correctly (#9289)

Fixes problems with checking text that cspell changes before spell checking, such as Thai text split into words with useIntlWordSegmentation, or text changed by substitutions (for example HTML entities or escaped quotes).

  • Thai text no longer stops the check with an error. Checking Thai text, or any text with useIntlWordSegmentation turned on, could stop with an internal error (AssertionError [ERR_ASSERTION]) on certain words. In cspell 10.3.3 and earlier, the file was reported as skipped and not checked. Starting with 10.3.4, the whole run failed. These files are now checked normally. The problem was found with the Thai word กระดูกสฟีนอยด์.
  • Issues are reported at the right place. When text was changed more than once before checking, for example by two sets of substitutions, issues after the first change could be reported at the wrong position in the file. They are now reported where the word actually is.
  • Substitutions without definitions are applied. Substitutions given directly as [find, replacement] pairs were ignored unless substitutionDefinitions was also set. They are now always applied.

Fixes #9281


Don't miss a new cspell release

NewReleases is sending notifications on new releases.