Skip to content

Replace use of whitelist with allowlist and blacklist with denylist #428

@estevanmaito

Description

@estevanmaito

We 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 (tailwindlabs/tailwindcss#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: rails/rails#33677

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions