Detalhes do pacote

cspell-populate-words

JoshuaKGoldberg25.9kMIT0.3.1

Populates your cspell.json dictionary with existing unknown words. 🔖

readme (leia-me)

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.

changelog (log de mudanças)

0.3.0 (2024-12-21)

Features

0.2.2 (2024-12-12)

Bug Fixes

  • throw error if no glob(s) provided (f0eb4ad)

0.2.1 (2024-12-11)

Bug Fixes

  • handle existing file not having words (cb2f513)

0.2.0 (2024-12-11)

Bug Fixes

  • don't treat cspell passing as unknown words (4231d2d)
  • empty commit to trigger release (c7a9e5a)

Features