tbroadley / spellchecker-cli

A command-line tool for spellchecking files.
MIT License
119 stars 16 forks source link

Add "dev words" support #84

Closed dawsbot closed 2 years ago

dawsbot commented 2 years ago

Words like npm and Vercel should always be allowed (both included in the default template for many new Next.js projects)

tbroadley commented 2 years ago

Hey, thank you for the issue! This seems like a good idea.

I would tweak the suggestion slightly. Rather than always allowing these words, I'd create a suite of default dictionary files for different kinds of projects (Next.js, React, etc). Then people could pass the path to the dictionary when invoking spellchecker:

spellchecker --dictionaries node_modules/spellchecker-cli/dictionaries/next-js.txt --files ...

It's verbose, but I think it's a good place to start. We could add some syntactic sugar on top, so that it isn't necessary to type out node_modules/spellchecker-cli/dictionaries.

Also, I don't know how people who have installed spellchecker-cli globally would know the path to these dictionaries. The syntactic sugar I mentioned above could help with this situation. In any case, I believe that people primarily install the package as a dev dependency.

I'm not actively working on this project. I can't promise I'll be adding any default dictionaries in the near future. However, I would review and merge a PR to add such a default dictionary for Next.js.

dawsbot commented 2 years ago

Makes sense, I appreciate the prompt response on this @tbroadley

I don't have strong conviction on this, I just came across the project and noticed these false positives to document