dillon1000/react
Commit
Browse files Update ValidatePreservedManualMemoization severity to CannotPreserveMemoization
We do need to fix the error location to point to the "callsite" rather than the definition of the useMemo callback, but that aside, even if the error message were perfect, it's not meant to be actionable to the user. So let's change the severity to CannotPreserveMemoization. This preserves the validation, but the eslint plugin won't report it. ghstack-source-id: 722c88922884de05e89030a7b001bd93e0a2a114 Pull Request resolved: https://github.com/facebook/react-forget/pull/2825
Changed paths7 files
First-parent comparisoncompiler/packages/babel-plugin-react-forget/src/Validation/ValidatePreservedManualMemoization.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-repro-unmemoized-callback-captured-in-context-variable.expect.md ModifiedM compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-useCallback-accesses-ref-mutated-later-via-function-preserve-memoization.expect.md ModifiedM compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-useCallback-set-ref-nested-property-ref-modified-later-preserve-memoization.expect.md ModifiedM compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/preserve-memo-validation/error.false-positive-useMemo-infer-mutate-deps.expect.md ModifiedM compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/preserve-memo-validation/error.invalid-useCallback-captures-reassigned-context.expect.md ModifiedM compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/preserve-memo-validation/error.todo-useCallback-captures-invalidating-value.expect.md ModifiedPatch
Files changed
Rendering syntax-highlighted changes…