Skip to content

Commit 7ee7571

Browse files
authored
[compiler] Enable validateNoVoidUseMemo in eslint & playground (facebook#34022)
Enables `validateNoVoidUseMemo` by default only in eslint (it defaults to false otherwise) as well as the playground.
1 parent 6b22f31 commit 7ee7571

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

compiler/apps/playground/components/Editor/EditorImpl.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ function compile(
219219
validateNoImpureFunctionsInRender: true,
220220
validateStaticComponents: true,
221221
validateNoFreezingKnownMutableFunctions: true,
222+
validateNoVoidUseMemo: true,
222223
}
223224
: {
224225
/* use defaults for compiler mode */

compiler/packages/eslint-plugin-react-compiler/src/rules/ReactCompilerRule.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ const COMPILER_OPTIONS: Partial<PluginOptions> = {
108108
validateNoImpureFunctionsInRender: true,
109109
validateStaticComponents: true,
110110
validateNoFreezingKnownMutableFunctions: true,
111+
validateNoVoidUseMemo: true,
111112
}),
112113
};
113114

packages/eslint-plugin-react-hooks/src/rules/ReactCompiler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ const COMPILER_OPTIONS: Partial<PluginOptions> = {
110110
validateNoImpureFunctionsInRender: true,
111111
validateStaticComponents: true,
112112
validateNoFreezingKnownMutableFunctions: true,
113+
validateNoVoidUseMemo: true,
113114
}),
114115
};
115116

0 commit comments

Comments
 (0)