Skip to content

Allow users to define preferred replacements for forbidden words #3777

@calvinballing

Description

@calvinballing

Is 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"]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions