tbroadley / spellchecker-cli

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

Option for capitalized words in Markdown headers #53

Closed miffels closed 4 years ago

miffels commented 4 years ago

Hey,

I am wondering, is there an option of some sorts that would prevent Capitalized Words in Markdown headers being reported? For instance,

# Using Namespaces

as "namespaces" isn't a common word, I am adding it to a dictionary

namespaces?

However, the spell checker will still report the header above as an issue, so I need to change the dictionary to

[Nn]amespaces?

which would allow "Namespace" to be used in the middle of a sentence, which is unintended. Is there a straightforward way for that kind of thing?

Cheers!

tbroadley commented 4 years ago

Thank you for creating an issue! Unfortunately no such option exists right now. I don't think there's currently a way to configure this tool to treat a sentence like "This is a Namespace" as an error but not a title like "# Using Namespaces".

It doesn't look like retext-spell, the library that this project uses to check spelling, doesn't catch mis-capitalized words even if they're spelled correctly:

➜ spellchecker-cli (master|…) cat example.md 
This sentence is Capitalized incorrectly.
➜ spellchecker-cli (master|…) node index.js example.md 

Spellchecking 1 file...

example.md: no issues found

And I couldn't find a Retext plugin that detects mis-capitalized words.

I'm definitely open to suggestions for handling this case.

miffels commented 4 years ago

Hey,

Ok, seems like it will allow capitalization by default and I simply need to write my dict to stick to that. Drawback would be that my team can Capitalize at will, but I guess there's worse. Thanks!