performance-lint-rules
This skill gives performance guidance for Oxc linter rule implementations.
Scope
Use this skill only for Rust code under crates/oxc_linter/src/rules/.
Do not use this skill for linter infrastructure, parser code, semantic analysis, formatter code, tests outside the rules directory, or unrelated crates.
Performance Guidelines
Prefer top-level node kind checks
Put node kind checks at the top level of the rule when possible. Rule runner implementations generated by lintgen can recognize implemented node types, which helps avoid invoking rules on unrelated AST nodes.
Do cheaper checks first
Order checks from cheapest and most selective to most expensive. Simple equality checks, early returns, and fast paths such as ASCII-only checks should come before semantic lookups, allocations, or deeper AST traversal.
Most rules trigger on only a small set of nodes, so quickly return for the common non-matching cases.
More from oxc-project/oxc
migrate-oxlint
Guide for migrating a project from ESLint to Oxlint. Use when asked to migrate, convert, or switch a JavaScript/TypeScript project's linter from ESLint to Oxlint.
3.1Kmigrate-oxfmt
Guide for migrating a project from Prettier or Biome to Oxfmt. Use when asked to migrate, convert, or switch a JavaScript/TypeScript project's formatter from Prettier or Biome to Oxfmt.
1.5Kinsta-snapshots
Guide for working with and updating insta snapshot tests in Oxc without terminal interaction.
49