refactor(linter): reduce repeated logic in JS plugin linting#17086
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the JS plugin linting code to eliminate duplicated conditional compilation logic. The main change introduces a helper method js_allocator_pool() that centralizes the platform-specific logic for retrieving the AllocatorPool, replacing multiple scattered #[cfg] attribute blocks.
- Introduces
js_allocator_pool()method to encapsulate conditional compilation logic - Removes duplicate
#[cfg]blocks from two call sites (lines 641-646 and 760-762) - Simplifies method calls to
run_with_disable_directives()by using the new helper
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging #17086 will not alter performanceComparing Summary
Footnotes
|
Merge activity
|
Follow-on after #17013. Pure refactor. Move logic for getting `AllocatorPool` into a function `js_allocator_pool`, to avoid lots of `#[cfg]` stuff.
5fb89fb to
73c9ebf
Compare
9a293a2 to
61f2138
Compare
Fix a typo that I introduced in #17086.

Follow-on after #17013. Pure refactor. Move logic for getting
AllocatorPoolinto a functionjs_allocator_pool, to avoid lots of#[cfg]stuff.