From 2cd374c30bf094cca2caf893c2a00c2c0fef3df3 Mon Sep 17 00:00:00 2001 From: Amin <26092352+aminamos@users.noreply.github.com> Date: Sun, 13 Sep 2026 19:55:06 -0500 Subject: [PATCH] tech-debt: enable typescript-eslint and react-hooks rules (#153) --- eslint.config.mjs | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index aa94178c..d6f27336 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -43,28 +43,31 @@ export default tseslint.config( ], // TODO: hooks called inside render callbacks, incorrect hook usage patterns, // and missing/extra effect dependencies — to be fixed in a separate ticket. - 'react-hooks/rules-of-hooks': 'off', + 'react-hooks/rules-of-hooks': 'error', 'react-hooks/refs': 'off', 'react-hooks/set-state-in-render': 'off', 'react-hooks/set-state-in-effect': 'off', - 'react-hooks/immutability': 'off', - 'react-hooks/exhaustive-deps': 'off', + 'react-hooks/immutability': 'warn', + 'react-hooks/exhaustive-deps': 'warn', // TypeScript handles these; disable the core JS versions. 'no-undef': 'off', 'no-unused-vars': 'off', - // Type-checked rules from recommendedTypeChecked that are too noisy - // for the current codebase — kept off to preserve parity with the - // previous eslint-config-standard-with-typescript baseline. - '@typescript-eslint/no-unsafe-assignment': 'off', - '@typescript-eslint/no-unsafe-member-access': 'off', - '@typescript-eslint/no-unsafe-argument': 'off', - '@typescript-eslint/no-unsafe-call': 'off', - '@typescript-eslint/no-unsafe-return': 'off', - '@typescript-eslint/no-unsafe-enum-comparison': 'off', - '@typescript-eslint/no-unnecessary-type-assertion': 'off', - '@typescript-eslint/no-redundant-type-constituents': 'off', + // Type-checked rules from recommendedTypeChecked that are progressively enabled + '@typescript-eslint/no-unsafe-assignment': 'warn', + '@typescript-eslint/no-unsafe-member-access': 'warn', + '@typescript-eslint/no-unsafe-argument': 'warn', + '@typescript-eslint/no-unsafe-call': 'warn', + '@typescript-eslint/no-unsafe-return': 'warn', + '@typescript-eslint/no-unsafe-enum-comparison': 'warn', + }, + }, + { + // Test files: `async` test callbacks and `act(async () => {})` wrappers are + // idiomatic even when they contain no `await` (async `act` flushes the + // microtask queue). Relaxing require-await here avoids churn in test infra. + files: ['**/*.spec.{ts,tsx}', '**/*.test.{ts,tsx}'], + rules: { '@typescript-eslint/require-await': 'off', - '@typescript-eslint/no-misused-promises': 'off', }, }, prettierRecommended,