performance-lint-rules

Installation
SKILL.md

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.

Related skills
Installs
5
Repository
oxc-project/oxc
GitHub Stars
21.1K
First Seen
5 days ago