Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(validator): add inclusive language aliases #2006

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sklawren
Copy link

@sklawren sklawren commented Jul 20, 2022

Adds inclusive language aliases for compatibility with eslint-plugin-inclusive-language which is being used by more and more companies (Microsoft, American Express, etc.). Fixes #2005.

Unlike #1522, this only adds aliases and does not change the current naming conventions nor rename any files.

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)

@codecov
Copy link

codecov bot commented Jul 20, 2022

Codecov Report

Merging #2006 (3adebf0) into master (450a2c0) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master     #2006   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          104       104           
  Lines         2203      2211    +8     
  Branches       477       482    +5     
=========================================
+ Hits          2203      2211    +8     
Impacted Files Coverage Δ
src/index.js 100.00% <ø> (ø)
src/lib/isEmail.js 100.00% <100.00%> (ø)
src/lib/isURL.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 450a2c0...3adebf0. Read the comment docs.

@rubiin rubiin requested a review from profnandaa July 20, 2022 05:53
@profnandaa profnandaa added the blocked For PRs that are blocked due to pending discussions, etc. label Jul 23, 2022
@profnandaa
Copy link
Member

We can review this later but I don't think this is a big deal on this project right now; I may be wrong...

@sklawren
Copy link
Author

@profnandaa This change is very minor it just adds aliases. The tech group at my company is insisting that I have to "fix" this violation of the eslint inclusive language rule set. It is out of my control. Other developers are likely to run into similar issues. Please consider merging this in since it will help developers who are stuck like me with company policies which we have no ability to change.

@rubiin
Copy link
Member

rubiin commented Jul 27, 2022

@profnandaa since this is not a breaking change , i think it would be right to merge it

@sklawren
Copy link
Author

sklawren commented Aug 9, 2022

I've come up with a creative workaround for anyone waiting on this PR.

You can resolve the eslint rule violation by making your own aliases using the base64 equivalent of whitelist and blacklist and using bracket access on validator.

export const allowlist = (value, chars) => validator[atob('d2hpdGVsaXN0')](value, chars);
export const denylist = (value, chars) => validator[atob('YmxhY2tsaXN0')](value, chars);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked For PRs that are blocked due to pending discussions, etc. 🍿 discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add aliases for blacklist/whitelist as blocklist/safelist
4 participants