From dc1cf7a3e3332361ed3c738521538e175c63be60 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Fri, 30 Jul 2021 12:42:41 -0700 Subject: [PATCH] Lint for british spelling Summary: I hate when I have to comment on a diff and tell somebody to please not use Her Majesty's Spelling, so I'll let the computer do the shouting. Mixing two ways of spelling the same thing just isn't fun. I had to work with an Android library that insisted on spelling it `colour`, leading to awkward code like `colour: COLORS.BLUE` which is just annoying and hard to remember. Reviewed By: lblasa Differential Revision: D30015807 fbshipit-source-id: 9f913e72617301273dbe12c60b9cdba8cea05537 --- desktop/.eslintrc.js | 2 ++ desktop/package.json | 1 + desktop/yarn.lock | 12 ++++++++++++ 3 files changed, 15 insertions(+) diff --git a/desktop/.eslintrc.js b/desktop/.eslintrc.js index d8c2a175f..c528a3ed2 100644 --- a/desktop/.eslintrc.js +++ b/desktop/.eslintrc.js @@ -44,6 +44,7 @@ module.exports = { 'react-hooks', 'flipper', 'promise', + 'communist-spelling', ], rules: { // disable rules from eslint-config-fbjs @@ -102,6 +103,7 @@ module.exports = { 'flipper/no-relative-imports-across-packages': [2], 'flipper/no-electron-remote-imports': [1], 'flipper/no-console-error-without-context': [1], + 'communist-spelling/communist-spelling': [1], // promise rules, see https://github.com/xjamundx/eslint-plugin-promise for details on each of them 'promise/catch-or-return': 'warn', diff --git a/desktop/package.json b/desktop/package.json index e0c9fe0ba..73ff14642 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -140,6 +140,7 @@ "eslint-config-prettier": "^8.3.0", "eslint-import-resolver-typescript": "^2.4.0", "eslint-plugin-babel": "^5.3.1", + "eslint-plugin-communist-spelling": "^1.0.0", "eslint-plugin-flipper": "0.0.0", "eslint-plugin-flowtype": "^5.8.2", "eslint-plugin-header": "^3.1.1", diff --git a/desktop/yarn.lock b/desktop/yarn.lock index 8e9ec41f2..1ce29635c 100644 --- a/desktop/yarn.lock +++ b/desktop/yarn.lock @@ -6580,6 +6580,13 @@ eslint-plugin-babel@^5.3.1: dependencies: eslint-rule-composer "^0.3.0" +eslint-plugin-communist-spelling@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-communist-spelling/-/eslint-plugin-communist-spelling-1.0.0.tgz#e90cc2a5c7de0cf679084ae516f81767c471229d" + integrity sha512-y6E30QAv5w0naTZq2xtEuKG0fndFFUG5aYuO4AOcTogcSnn6B87K24+GAoxM9/ddS+rfPvghmifCy5xSb0gh0A== + dependencies: + requireindex "~1.1.0" + eslint-plugin-es@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-3.0.0.tgz#98cb1bc8ab0aa807977855e11ad9d1c9422d014b" @@ -12199,6 +12206,11 @@ require-main-filename@^2.0.0: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== +requireindex@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.1.0.tgz#e5404b81557ef75db6e49c5a72004893fe03e162" + integrity sha1-5UBLgVV+91225JxacgBIk/4D4WI= + reselect@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/reselect/-/reselect-4.0.0.tgz#f2529830e5d3d0e021408b246a206ef4ea4437f7"