0.3.0 โ€ข Published 6 months ago

cspell-populate-words v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

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"] });

Contributors

๐Ÿ’™ This package was templated with create-typescript-app.

0.3.0

6 months ago

0.2.2

6 months ago

0.2.1

6 months ago

0.2.0

6 months ago

0.1.0

6 months ago