muenzpraeger / eslint-plugin-inclusive-language

An ESLint plugin to raise awareness for using inclusive language not only in your codebase, but in life.
MIT License
56 stars 10 forks source link

Suggestion: Support multiple non-inclusive terms & suggestions #30

Open sharmilajesupaul opened 3 years ago

sharmilajesupaul commented 3 years ago

This is a small nice to have, but I figured it would be worth asking.

We have some duplication in our configuration when trying to match words like whitelist, white-list, and white_list which should have the same group of suggestions.

It would be great if the rule could allow a group of terms and suggestions.

So we can configure something like this:

        {
          terms: ['whitelist', 'white-list', 'white_list'],
          suggestions: ['allowlist'],
        },
        {
          terms: ['blacklist', 'black-list', 'black_list'],
          suggestions: ['denylist'],
        }

The linter would warn on any words in the terms list and use the suggestions the same way. Let me know what you think.

github-actions[bot] commented 3 years ago

Welcome! 👋

Thanks you for creating the issue. 🙌 I will come back to this as soon as possible.

muenzpraeger commented 3 years ago

That sounds like a good idea!

IMHO it should be either/and. Meaning a string or an array of strings. At least for some time, so that it's not another breaking change/major version. ;-)

I can look into that tomorrow. Or feel free to submit a PR. It's all open-source for a good reason. 🤩

sharmilajesupaul commented 3 years ago

sure! I figured having the key word might be confusing if it also supported multiple 😅