Allow users to define preferred replacements for forbidden words
See original GitHub issueIs your feature request related to a problem? Please describe.
If a user receives a message that a word is forbidden, they may not understand why the word is forbidden, or what to do instead. For example, say that you want to enforce that canceled
is spelled with one l
instead of two, so you mark cancelled
as forbidden.
However, users may now get a message such as Forbidden word (cancelled)
, and not know how to proceed, since the word cancelled
is valid in many contexts.
Describe the solution you’d like
When defining a forbidden word, allow for each word to have an optional suggested replacement. Then, instead of the possibly surprising:
Forbidden word (cancelled)
If a suggested replacement is defined, it would read something like:
Forbidden word (cancelled). Suggested replacement: 'canceled'
Possibly you could use a space as a separator (does space have other possible meanings in the dictionary context?)
In a custom word list:
!forbiddenWord suggestedReplacement
In words section of cspell configuration:
"words": [
"!forbiddenWord suggestedReplacement
],
In flagWords section of cspell configuration:
"flagWords": ["forbiddenWord suggestedReplacement"]
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top GitHub Comments
I believe my problem was a local issue, where I had multiple concurrent versions of cspell, and I wasn’t running the latest one from the command line. It’s working for me now!
@calvinballing,
At the moment, it only shows the suggestion if you use
--show-suggestions
: