MCPInstall
oxc-project/oxc avatar

performance-lint-rules

Performance review guidance for Oxc linter rule implementations. Use only when reviewing Rust rule code under crates/oxclinter/src/rules/ or when explicitly auditing those rules for performance improvements.

Installs
222
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/oxc-project/oxc --skill performance-lint-rules
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads performance-lint-rules automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Performance Guidelines

Prefer top-level node kind checks

Put node kind checks at the rule entry point. If a rule only handles a few syntactic forms, start run with an AstKind match and return for all other nodes, even when a helper filters again internally. This lets lintgen derive narrower NODE_TYPES and avoids dispatching the rule on unrelated AST nodes.

After changing the relevant node kinds for a rule, regenerate the rule runner with cargo lintgen and consider adding or updating assert_rule_runs_on_node_types coverage in crates/oxc_linter/src/rule.rs.

Implement only the needed entry point. If a rule is a whole-file pass over semantic indexes, use run_once by itself. Implementing both run and run_once prevents useful node-type narrowing.

Do cheaper checks first

Order checks from cheapest and most selective to most expensive. Return quickly for common non-matches before doing semantic lookups, allocations, or deeper traversal.

  • Matching a small fixed string set with matches! before semantic checks.
  • Rejecting lowercase identifiers before global-object checks when only constructors can match.
  • Checking whether a JSX attribute starts with aria- before lowercasing it.
  • Checking for required syntax such as a key prop before looking up callback parameter symbols.
  • Checking source_range(span).contains("this") before running a visitor that only finds this.

Delay expensive context

Most files do not contain lint errors. Do not prepare diagnostics, labels, help text, fix data, ancestors, symbols, JSX element types, or replacement strings until the rule has found a syntactic candidate that could actually report.

Iterate over the smallest set possible

  • Use run_once when the rule only needs a whole-file pass and does not need to run on every node.
  • Iterate over symbols instead of AST nodes when looking for references to specific names.
  • Prefer targeted lists or semantic data over broad AST traversal when available.
  • For name-based binding checks, use ctx.scoping().get_binding(scope_id, name) instead of scanning every binding in get_bindings(scope_id).
  • For global or unresolved identifier checks, start from ctx.scoping().root_unresolved_references().get(name) for the small set of relevant names instead of visiting every IdentifierReference.
  • When iterating unresolved references, still verify the reference is the right kind: skip references with a symbol, type-only references, and nodes whose AstKind is not the expected identifier or member access.
  • When checking imported specifiers or exported names, iterate the concrete specifiers or precomputed export set rather than scanning all root bindings for every item.

Use precomputed FxHashSets only when many symbols need the same membership test. Prefer keyed semantic lookup when each lookup already has an exact name.

Avoid unnecessary regular expressions

Avoid regular expressions when byte or string checks are enough: contains, starts_with, ends_with, or matching a small fixed set.

For hot comment or string scanning paths, prefer a cheap memchr or byte search to reject most inputs, then parse only candidates. Preserve regex semantics when replacing one, especially identifier boundaries, optional prefixes, and multiline whitespace.

Avoid heap allocations

  • Use copy-on-write utilities when a value usually does not need to change.
  • Avoid intermediate Vecs and Strings when iteration or borrowed data is enough.
  • Keep temporary data on the stack when practical.
  • Delay allocation until a diagnostic, fix, or transformed value is actually needed.
  • Use allocation-free ASCII comparisons such as starts_with_ignore_case before calling cow_to_ascii_lowercase.
  • Use byte scans such as as_bytes().array_windows() for simple ASCII patterns like escape sequences.
  • Reserve hash maps or sets when the final size is known.
  • Avoid building a HashSet just to check names that can be looked up directly in scoping data.

FAQ

What does the performance-lint-rules skill do?

Performance review guidance for Oxc linter rule implementations. Use only when reviewing Rust rule code under crates/oxclinter/src/rules/ or when explicitly auditing those rules for performance improvements.

How do I install performance-lint-rules?

Run npx skills add https://github.com/oxc-project/oxc --skill performance-lint-rules in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/performance-lint-rules/ (personal) or .claude/skills/performance-lint-rules/ (project).

Which AI agents can use performance-lint-rules?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is performance-lint-rules safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains performance-lint-rules?

It is published by oxc-project/oxc in oxc-project/oxc. It has 222 recorded installs.

More from oxc-project/oxc

View all →
oxc-project/oxc avatar

migrate-oxlint

oxc-project/oxc

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.

oxc-project/oxc avatar

migrate-oxfmt

oxc-project/oxc

Guide for migrating a project from Prettier or Biome to Oxfmt. Use when asked to migrate, convert, or switch a project's formatter from Prettier or Biome to Oxfmt.

4.4K installs
oxc-project/oxc avatar

insta-snapshots

oxc-project/oxc

Review and update Oxc Insta snapshots non-interactively after expected output changes or snapshot test failures.

Testing & QA174 installs

Popular code quality & workflow skills

View category →
mattpocock avatar

grill-me

mattpocock/skills

A relentless interview to sharpen a plan or design.

Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

mattpocock avatar

handoff

mattpocock/skills

Compact the current conversation into a handoff document for another agent to pick up.

mattpocock avatar

domain-modeling

mattpocock/skills

Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.

mattpocock avatar

codebase-design

mattpocock/skills

Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.

mattpocock avatar

diagnosing-bugs

mattpocock/skills

Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.