From 4e66afad0acfce834c1a5029ed32dc6bd9924379 Mon Sep 17 00:00:00 2001 From: "LB (Ben Johnston)" Date: Fri, 9 Dec 2022 17:33:28 +1000 Subject: [PATCH] Eslint - disable rule class-methods-use-this (#9482) --- .eslintrc.js | 4 ++-- client/src/includes/chooserModal.js | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index e23686d29c..d347454cad 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,7 +1,6 @@ // Rules which have been enforced in configuration upgrades and flag issues in existing code. // We need to consider whether to disable those rules permanently, or fix the issues. const legacyCode = { - 'class-methods-use-this': 'off', 'constructor-super': 'off', 'default-param-last': 'off', 'no-continue': 'off', @@ -27,6 +26,8 @@ module.exports = { '@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-use-before-define': ['error'], + // it is often helpful to pull out logic to class methods that may not use `this` + 'class-methods-use-this': 'off', 'import/extensions': [ 'error', 'always', @@ -72,7 +73,6 @@ module.exports = { 'client/src/entrypoints/admin/page-editor.js', 'client/src/entrypoints/admin/telepath/widgets.js', 'client/src/entrypoints/contrib/typed_table_block/typed_table_block.js', - 'client/src/entrypoints/images/image-chooser-modal.js', 'client/src/utils/actions.ts', 'client/src/utils/version.js', ], diff --git a/client/src/includes/chooserModal.js b/client/src/includes/chooserModal.js index 0b49acd982..106c371eef 100644 --- a/client/src/includes/chooserModal.js +++ b/client/src/includes/chooserModal.js @@ -230,7 +230,6 @@ class ChooserModalOnloadHandlerFactory { initTooltips(); } - // eslint-disable-next-line class-methods-use-this modalHasTabs(modal) { return $('[data-tabs]', modal.body).length; }