dillon1000/react
Commit
Browse files [compiler] Fix inferEffectDependencies lint false positives (#32769)
Currently, inferred effect dependencies are considered a "compiler-required" feature. This means that untransformed callsites should escalate to a build error. `ValidateNoUntransformedReferences` iterates 'special effect' callsites and checks that the compiler was able to successfully transform them. Prior to this PR, this relied on checking the number of arguments passed to this special effect. This obviously doesn't work with `noEmit: true`, which is used for our eslint plugin (this avoids mutating the babel program as other linters run with the same ast). This PR adds a set of `babel.SourceLocation`s to do best effort matching in this mode.
Changed paths9 files
First-parent comparisoncompiler/packages/babel-plugin-react-compiler/src/Babel/BabelPlugin.ts ModifiedM compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Program.ts ModifiedM compiler/packages/babel-plugin-react-compiler/src/Entrypoint/ValidateNoUntransformedReferences.ts ModifiedM compiler/packages/babel-plugin-react-compiler/src/HIR/Environment.ts ModifiedM compiler/packages/babel-plugin-react-compiler/src/Inference/InferEffectDependencies.ts ModifiedM compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/CodegenReactiveFunction.ts ModifiedA compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-effect-dependencies/no-emit-lint-repro.expect.md AddedA compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-effect-dependencies/no-emit-lint-repro.js AddedM compiler/packages/snap/src/compiler.ts ModifiedPatch
Files changed
Rendering syntax-highlighted changes…