oxc
oxc copied to clipboard
perf(linter): re-use possible jest nodes across rules
Your org has enabled the Graphite merge queue for merging into main
Add the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.
You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.
This stack of pull requests is managed by Graphite. Learn more about stacking.
Join @camchenry and the rest of your teammates on
Graphite
The main issue I'm running into here is:
error[E0515]: cannot return value referencing local variable `jest_nodes`
--> crates/oxc_linter/src/lib.rs:157:9
|
150 | for node in &jest_nodes {
| ----------- `jest_nodes` is borrowed here
...
157 | ctx_host.take_diagnostics()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ returns a value referencing data owned by the current function