Replace use of whitelist with allowlist and blacklist with denylist
See original GitHub issueWe can use better terminology and promote diversity.
As stated in the CODE_OF_CONDUCT:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Whitelists would become allowlists
Blacklists would become denylists
This is what I proposed for Tailwind CSS (https://github.com/tailwindcss/tailwindcss/issues/1868) to map to PurgeCSS’ options:
whitelist
->allowlist
whitelistPatterns
->allowlistPatterns
whitelistPatternsChildren
->allowlistPatternsChildren
The unwelcoming terms could still be supported, but no more documented. It would not break any code already using it but would enforce better standards for future.
It has to start somewhere. Good documentation on our side would reduce the friction and send a message: we are doing our part.
I’m not familiar with the codebase, but would be willing to make these changes as in most of the cases it would be documentation and renaming (yes, I propose to also change internal code, but leave the minimum necessary to keep old properties working)
inspired by Rails: https://github.com/rails/rails/issues/33677
Issue Analytics
- State:
- Created 3 years ago
- Reactions:52
- Comments:9 (4 by maintainers)
wholehearted +1000
I think that especially since this can be done with no breaking changes there’s no reason not to use try and use less divisive terminology here.
I think the proposed
allowlist
anddenylist
are not great because the definitions of the wordsallow
anddeny
aren’t perfect metaphors for what the options do — they make sense in other contexts but here it’s more about preserving than allowing. I think when making a change like this we should aim to choose a name that is not only more inclusive than “whitelist” but also better, like DHH talks about in the linked Rails issue.It’s worth noting is that there is no “blacklist” feature/option in PurgeCSS currently, so we only really have to think of something for “whitelist”.
I’ve been thinking through different options and I think the one I like most is
safelist
. It’s actually shorter than whitelist, and has history of being used in place of “whitelist” in other contexts, like email for example.