What problem does it solve?
Linter rules that run on every AST node or perform unnecessary allocations, regex evaluations, and semantic lookups slow down the entire linting pipeline. This Skill provides concrete performance review guidance for auditing and optimizing Rust rule implementations in the Oxc linter.
Core Features & Use Cases
- Node Kind Narrowing: Guides placing AstKind checks at rule entry points so lintgen derives narrower NODE_TYPES and avoids dispatching rules on unrelated nodes.
- Cheap-First Check Ordering: Recommends ordering checks from cheapest to most expensive, delaying diagnostics, allocations, and semantic lookups until a real candidate is found.
- Allocation and Regex Avoidance: Promotes byte-level scans, copy-on-write utilities, and targeted scoping lookups over heap allocations and regular expressions.
- Use Case: When reviewing a pull request that adds a new rule under crates/oxc_linter/src/rules/, apply this guidance to catch rules that iterate all AST nodes instead of using run_once or unresolved-reference lookups.
Quick Start
Review the Rust rule code in crates/oxc_linter/src/rules/ for performance issues using the performance lint rules guidance.