Remove the unnecessary intermediate variables, restating comments, redundant type annotations, and imprecise names that make code longer without making it clearer. Use when writing or reviewing any TypeScript in this repository, especially code written with…
Write and review typescript-eslint documentation with objective, verifiable claims and self-contained code examples. Use when changing Markdown or MDX in docs or packages/eslint-plugin/docs.
Write rule fixers and suggestions that never delete comments, using tokens rather than character arithmetic, and leaving formatting to the formatter. Use when adding or reviewing a `fix` or `suggestions` implementation in packages/eslint-plugin.
Follow this repository's conventions for messageIds, report messages, rule options, preset placement, and deprecations. Use when adding a rule, adding or renaming a rule option, changing a report message, or deprecating public API.
Find and apply performance wins in typed lint rules by deferring expensive TypeScript type lookups behind cheap AST/syntactic guards. Use when writing or reviewing a rule in packages/eslint-plugin that calls the type checker.
Move logic copied between rules into a shared util, reuse the utils that already exist instead of reimplementing them, and migrate call sites when adding a new one. Use when a PR adds a non-trivial helper function to a rule, or reimplements type or AST logic…
Write rule test cases the way this repo expects — one logical unit per test case, static self-contained snippets, comments only when they add meaning, and precise error assertions. Use when adding or changing tests in packages/eslint-plugin/tests/rules or…
Fix imprecise types at their source instead of papering over them with runtime checks, assertion helpers, or `in` narrowing. Use when reviewing or writing code that adds a guard, an assertion, or an optional chain only to satisfy the type checker.