Migrate Oxfmt
22.5kGuía para migrar un proyecto JavaScript/TypeScript de Prettier o Biome a Oxfmt.
- Costo de contexto al activarse
- 2.8k tok
- Tamaño del paquete
- 1 archivo
- Última actualización
- hace 11 días
Guía de rendimiento para implementaciones de reglas del linter de Oxc. Úsalo solo al revisar código Rust bajo crates/oxc_linter/src/rules/ o al auditar esas reglas explícitamente.
en todo el repo
0–100, la ruta de este skill
último commit aquí
últimos 90 días
52 tok en reposo
4 KB
Funciona con cualquier agente que lea SKILL.md
npx -y skills add oxc-project/oxc --skill performance-lint-rules --agent claude-codeSe instala solo en este repositorio.
Di cualquiera de estas frases y el agente debería cargar este skill.
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.
Order checks from cheapest and most selective to most expensive. Return quickly for common non-matches before doing semantic lookups, allocations, or deeper traversal.
matches! before semantic checks.aria- before lowercasing it.key prop before looking up callback parameter symbols.source_range(span).contains("this") before running a visitor that only finds this.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.
run_once when the rule only needs a whole-file pass and does not need to run on every node.ctx.scoping().get_binding(scope_id, name) instead of scanning every binding in get_bindings(scope_id).ctx.scoping().root_unresolved_references().get(name) for the small set of relevant names instead of visiting every IdentifierReference.AstKind is not the expected identifier or member access.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 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.
Vecs and Strings when iteration or borrowed data is enough.starts_with_ignore_case before calling cow_to_ascii_lowercase.as_bytes().array_windows() for simple ASCII patterns like escape sequences.HashSet just to check names that can be looked up directly in scoping data.Reproducido de oxc-project/oxc bajo licencia MIT. Leer esta página en markdown.
1 archivo en el paquete. Solo se lee SKILL.md al activarse — las referencias se cargan si el skill decide que las necesita.
Este repo incluye 4 skills. Si instalas uno, normalmente ya tienes los demás.
Guía para migrar un proyecto JavaScript/TypeScript de Prettier o Biome a Oxfmt.
Guía para migrar un proyecto JavaScript/TypeScript de ESLint a Oxlint.
Guía para trabajar con y actualizar los tests de snapshot de insta en Oxc sin necesitar interacción con la terminal.
Guía para migrar un proyecto JavaScript/TypeScript de Prettier o Biome a Oxfmt.
Guía para migrar un proyecto JavaScript/TypeScript de ESLint a Oxlint.
Guía para trabajar con y actualizar los tests de snapshot de insta en Oxc sin necesitar interacción con la terminal.