KEMBAR78
GitHub - JoshuaKGoldberg/cspell-populate-words: Populates your cspell.json dictionary with existing unknown words. πŸ”–
Skip to content

JoshuaKGoldberg/cspell-populate-words

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

CSpell Populate Words

Populates your cspell.json dictionary with existing unknown words. πŸ”–

πŸ‘ͺ All Contributors: 1 🀝 Code of Conduct: Kept πŸ§ͺ Coverage πŸ“ License: MIT πŸ“¦ npm version πŸ’ͺ TypeScript: Strict

Usage

Run cspell-populate-words as a command in your CLI to add any words currently reported by cspell as typos to the words array in your cspell.json.

npx cspell-populate-words "**/*"

If a cspell.json doesn't yet exist, one will be created for you.

If the prettier package is available, such as already being a dependency in your repository, it will be used to format the file.

Options

cspell-populate-words takes in any non-zero number of file globs to look at. The file globs are passed directly to the cspell CLI.

For example, to look at all files, and opt into .github/:

npx cspell \"**/*\" \".github/**/*\"

--words

Any number of --words can be provided along with -or instead of- positional file globs. These words will be passed to cspell's stdin option.

For example, providing mistake, typo, and zzz as words:

npx cspell --words mistake --words "typo zzz"

Providing typo alongside file globs:

npx cspell \"**/*\" --words typo

Node.js API

A populateWords function is exported that you can use programmatically. It takes in globs and/or words string[]s similar to the CLI:

npm i cspell-populate-words
import { populateWords } from "cspell-populate-words";

await populateWords({ globs: ["**/*"] });
await populateWords({ words: ["mistake", "typo zzz"] });
await populateWords({ globs: ["**/*"], words: ["mistake", "typo zzz"] });

Development

See .github/CONTRIBUTING.md, then .github/DEVELOPMENT.md. Thanks! πŸ”–

Contributors

Josh Goldberg ✨
Josh Goldberg ✨

πŸ’» πŸ–‹ πŸ“– πŸ€” πŸš‡ 🚧 πŸ“† πŸ”§

πŸ’ This package was templated with create-typescript-app using the Bingo engine.

About

Populates your cspell.json dictionary with existing unknown words. πŸ”–

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •