Open Zamiell opened 2 years ago
@Zamiell,
Please try files
. It is better documented in the Spell Checker Extension: Configuration Settings - Spell Checker.
{
"version": "0.2",
"words": [
"foo"
],
"files": [
"src/**/*.ts",
"docs/**/*.md"
]
}
Thanks Jason, that works great. Shouldn't all of the configuration options be documented on this page?
Thanks Jason, that works great. Shouldn't all of the configuration options be documented on this page?
It should be. It just hasn't happened yet.
The intent is to generate the documentation from the cspell/cspell.schema.json file. That is how it is generated for the Extension website.
Related to #571
Ok, thank you.
Related question: In Prettier, it is possible to check my entire repository (recursively) with:
$ npx prettier . --check
ESlint works in the same way, i.e. you can just specify a dot and it will recursively check everything.
With CSpell, that does not seem to be possible:
$ npx cspell .
CSpell: Files checked: 0, Issues found: 0 in 0 files
npx cspell *
instead, it only checks for files in the current directory (non-recursively).npx cspell **/*.*
instead, it only checks for files in subdirectories (recursively but not for files in the current directory).Is it possible to specify some sequence of characters to search for all files? And should CSpell be changed to work like ESLint/Prettier in this regard?
Please try:
$ npx cspell "**"
I had not realize prettier and ESLint had that. I think they are matching git's behavior: git add .
That works, thank you! Should I open a separate issue for npx cspell .
?
That works, thank you! Should I open a separate issue for
npx cspell .
?
Yes.
Hello again,
CSpell is a fantastic tool, and many projects use CSpell to spell-check their entire repository. However, you don't want to use the tool on the entire repository, because e.g. you don't care about the
node_modules
directory. So, you would spell-check a subset of it, like so:perform_spell_check.sh
But these two globs are hard coded, which is bad. It would be better if users could instead specify the glob patterns that correspond to their respective projects in the CSpell configuration file, like this:
.cspell.json
Then, one could simply do a
npx cspell
, and since no glob patterns were specified on the command-line, CSpell would assume that the user wants to spell check the project itself, and it would automatically use the globs found in the "includePaths" option.Furthermore, this feature could also be tied in to the VSCode extension. If I open a project in VSCode, the extension can read the "includePaths" option in order to know whether or not it should show the blue squiggly lines for the particular file that I have open. (I guess that once the feature is in place, this would happen automatically? Not 100% sure.)
This is related to issue #2536, because I want to ensure that there are no orphaned words in the CSpell configuration file, and perform this check in CI. But since there is no central location for "which files to spell check", I have to repeat the globs in multiple places, violating the DRY principle, and potentially causing bugs if any of the globs change later on.