validator.js icon indicating copy to clipboard operation
validator.js copied to clipboard

feat(validator): add inclusive language aliases

Open sklawren opened this issue 3 years ago • 5 comments

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 https://github.com/validatorjs/validator.js/issues/2005.

Unlike https://github.com/validatorjs/validator.js/pull/1522, this only adds aliases and does not change the current naming conventions nor rename any files.

Checklist

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

sklawren avatar Jul 20 '22 02:07 sklawren

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.

codecov[bot] avatar Jul 20 '22 03:07 codecov[bot]

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

profnandaa avatar Jul 23 '22 08:07 profnandaa

@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.

sklawren avatar Jul 25 '22 23:07 sklawren

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

rubiin avatar Jul 27 '22 14:07 rubiin

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);

sklawren avatar Aug 09 '22 04:08 sklawren