feat(validator): add inclusive language aliases
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)
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 dataPowered by Codecov. Last update 450a2c0...3adebf0. Read the comment docs.
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 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.
@profnandaa since this is not a breaking change , i think it would be right to merge it
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);