You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[compiler] Cleanup and enable validateNoVoidUseMemo (#34882)
This is a great validation, so let's enable by default. Changes:
* Move the validation logic into ValidateUseMemo alongside the new check
that the useMemo result is used
* Update the lint description
* Make the void memo errors lint-only, they don't require us to skip
compilation (as evidenced by the fact that we've had this validation
off)
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/34882).
* #34855
* __->__ #34882
DiffTrain build for [1324e1b](1324e1b)
Copy file name to clipboardExpand all lines: compiled/eslint-plugin-react-hooks/index.js
+32-37Lines changed: 32 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -18309,7 +18309,7 @@ function getRuleForCategoryImpl(category) {
18309
18309
category,
18310
18310
severity: ErrorSeverity.Error,
18311
18311
name: 'void-use-memo',
18312
-
description: 'Validates that useMemos always return a value. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.',
18312
+
description: 'Validates that useMemos always return a value and that the result of the useMemo is used by the component/hook. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.',
0 commit comments