diff --git a/index.js b/index.js index 3065cc3..c179773 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,4 @@ +/* eslint-disable inclusive-language/use-inclusive-words */ /* * Copyright (c) 2017 American Express Travel Related Services Company, Inc. * @@ -53,6 +54,7 @@ module.exports = { }, plugins: [ 'import', + 'inclusive-language', 'jsx-a11y', 'markdown', 'react', @@ -219,6 +221,32 @@ module.exports = { // reduces the unnecessary boilerplate of explicitly setting props to `undefined` // prevent false-confidence for those less experienced with how default props work 'react/require-default-props': 'off', + + // encourage the use of inclusive language + 'inclusive-language/use-inclusive-words': [ + 'error', + { + words: [ + { + word: 'blacklist', + suggestions: ['blocklist', 'denylist', 'deny', 'block', 'unapproved'], + }, + { + word: 'whitelist', + suggestions: ['allowlist', 'passlist', 'allow', 'permit', 'approved'], + }, + { + word: 'master', + suggestions: ['main', 'primary', 'host', 'leader'], + }, + { + word: 'slave', + suggestions: ['secondary', 'replica', 'client', 'follower'], + }, + ], + lintStrings: true, + }, + ], }, overrides: [{ // Certain rules need to be disabled when we are linting markdown files, diff --git a/package-lock.json b/package-lock.json index a0434e3..7844720 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3770,6 +3770,14 @@ } } }, + "eslint-plugin-inclusive-language": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-inclusive-language/-/eslint-plugin-inclusive-language-2.1.1.tgz", + "integrity": "sha512-/dJC035CntrE7JpmQk0lId340iJZ3wUp22dUIy33CVSbO0t9jffeIe0lM0H9281ISdfB4oERvbq3iMK7f0YRDQ==", + "requires": { + "humps": "^2.0.1" + } + }, "eslint-plugin-jest": { "version": "24.1.3", "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-24.1.3.tgz", @@ -4830,6 +4838,11 @@ "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", "dev": true }, + "humps": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/humps/-/humps-2.0.1.tgz", + "integrity": "sha1-3QLqYIG9BWjcXQcxhEY5V7qe+ao=" + }, "husky": { "version": "4.3.5", "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.5.tgz", diff --git a/package.json b/package.json index 8eb5fe7..4d5f667 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "eslint-config-airbnb": "^18.2.1", "eslint-config-prettier": "^7.0.0", "eslint-plugin-import": "^2.22.1", + "eslint-plugin-inclusive-language": "^2.1.1", "eslint-plugin-jsx-a11y": "^6.4.1", "eslint-plugin-markdown": "^1.0.2", "eslint-plugin-react": "^7.21.5",