oxc icon indicating copy to clipboard operation
oxc copied to clipboard

perf(linter): re-use possible jest nodes across rules

Open camchenry opened this issue 1 year ago • 3 comments

camchenry avatar Sep 25 '24 04:09 camchenry

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.

graphite-app[bot] avatar Sep 25 '24 04:09 graphite-app[bot]

  • #6049 Graphite 👈
  • main

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @camchenry and the rest of your teammates on Graphite Graphite

camchenry avatar Sep 25 '24 04:09 camchenry

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

camchenry avatar Sep 25 '24 04:09 camchenry