-
Notifications
You must be signed in to change notification settings - Fork 664
feat(rome_js_analyze): exhaustive deps for React hooks #3355
Conversation
✅ Deploy Preview for rometools ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
222dda3
to
eda2ae6
Compare
!bench_analyzer |
Analyzer Benchmark Results
|
1fe5806
to
b604dd5
Compare
!bench_analyzer |
Analyzer Benchmark Results
|
Ema mentioned on an other PR that nursery rules are probably not run as part of our benchmarks. It probably makes sense to double check that and potentially fix in a separate PR to get clear signal on perf. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I skimmed a bit the PR, I will do a second pass later. There's one thing that I am struggling with. We use "capture" a lot... but this is a concept I am not familiar with. Can we explain it somewhere? I checked the struct Capture
and the explanation doesn't help me. Can we explain it better? I wouldn't be able to help if I don't understand the concept.
crates/rome_js_analyze/src/semantic_analyzers/nursery/react_extensive_dependencies.rs
Outdated
Show resolved
Hide resolved
crates/rome_js_analyze/src/semantic_analyzers/nursery/react_extensive_dependencies.rs
Outdated
Show resolved
Hide resolved
crates/rome_js_analyze/src/semantic_analyzers/nursery/react_extensive_dependencies.rs
Outdated
Show resolved
Hide resolved
crates/rome_js_analyze/src/semantic_analyzers/nursery/react_extensive_dependencies.rs
Outdated
Show resolved
Hide resolved
...rome_js_analyze/tests/specs/nursery/reactExtensiveDependencies/missingDependenciesInvalid.js
Outdated
Show resolved
Hide resolved
crates/rome_js_analyze/src/semantic_analyzers/nursery/react_extensive_dependencies.rs
Outdated
Show resolved
Hide resolved
crates/rome_js_analyze/src/semantic_analyzers/nursery/react_extensive_dependencies.rs
Outdated
Show resolved
Hide resolved
crates/rome_js_analyze/src/semantic_analyzers/nursery/react_extensive_dependencies.rs
Outdated
Show resolved
Hide resolved
crates/rome_js_analyze/src/semantic_analyzers/nursery/react_extensive_dependencies.rs
Outdated
Show resolved
Hide resolved
e2a3417
to
63525d4
Compare
394edf4
to
3b345a2
Compare
@MichaReiser could you give a second look to this PR? It would be great to have it merged for the |
/// Name of the React hook | ||
hook_name: String, | ||
/// Index of the position of the stable return, [None] if | ||
/// none returns are stable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc issue: [None]
if the entire return value is stable.
Summary
This PR implements the lint rule that will check React hooks are correctly specifying dependencies.
See #3357 (comment)
Closes #3478
This PR implements
Test Plan