From d2fd7dea975be0d87f5bd13fac08a5d20e312f79 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Tue, 11 Jun 2024 20:40:36 +0530 Subject: [PATCH] Add an exception --- web/apps/accounts/.eslintrc.js | 1 - web/packages/build-config/eslintrc-base.js | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/web/apps/accounts/.eslintrc.js b/web/apps/accounts/.eslintrc.js index fc6d400d50..eb420ede9e 100644 --- a/web/apps/accounts/.eslintrc.js +++ b/web/apps/accounts/.eslintrc.js @@ -6,7 +6,6 @@ module.exports = { "react/react-in-jsx-scope": "off", "react/prop-types": "off", "react-hooks/exhaustive-deps": "off", - "@typescript-eslint/no-misused-promises": "off", "@typescript-eslint/no-explicit-any": "off", "react-refresh/only-export-components": "off", }, diff --git a/web/packages/build-config/eslintrc-base.js b/web/packages/build-config/eslintrc-base.js index 3e65638c1b..95d9976521 100644 --- a/web/packages/build-config/eslintrc-base.js +++ b/web/packages/build-config/eslintrc-base.js @@ -25,5 +25,20 @@ module.exports = { ignoreArrowShorthand: true, }, ], + /* + Allow async functions to be passed as JSX attributes expected to be + functions that return void (typically onFoo event handlers). + + This should be safe since we have registered global unhandled Promise + handlers. + */ + "@typescript-eslint/no-misused-promises": [ + "error", + { + checksVoidReturn: { + attributes: false, + }, + }, + ], }, };