Skip to content

refactor: type RuleModule docs generic for requiresTypeChecking - #964

Open
bmish wants to merge 1 commit into
mainfrom
cleanup/rule-module-docs-generic
Open

refactor: type RuleModule docs generic for requiresTypeChecking#964
bmish wants to merge 1 commit into
mainfrom
cleanup/rule-module-docs-generic

Conversation

@bmish

@bmish bmish commented Jun 7, 2026

Copy link
Copy Markdown
Member

Summary

meta.docs.requiresTypeChecking is a common ESLint-ecosystem convention but isn't part of @typescript-eslint/utils' standard RuleMetaDataDocs type. We were working around that with three identical @ts-expect-error suppressions.

This passes { requiresTypeChecking?: boolean } as the Docs generic to TSESLint.RuleModule (its third type parameter, which flows into meta.docs), so the property is properly typed in one place — removing all three suppressions.

Changes

  • lib/types.ts — augment the RuleModule Docs generic.
  • lib/rule-list.ts, lib/rule-list-columns.ts, lib/rule-doc-notices.ts — drop the now-unnecessary @ts-expect-error comments (and a redundant as boolean | undefined cast).

Test plan

  • npm run lint:types passes.
  • eslint passes on changed files.
  • Full test suite green (350 tests).

🤖 Generated with Claude Code

Pass `{ requiresTypeChecking?: boolean }` as the `Docs` generic to
`TSESLint.RuleModule` so `meta.docs.requiresTypeChecking` is typed. This
removes three identical `@ts-expect-error` suppressions that worked around
the property being absent from the standard `RuleMetaDataDocs` type.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bmish
bmish marked this pull request as ready for review June 7, 2026 21:09
@bmish
bmish requested a review from MichaelDeBoey June 7, 2026 21:13
@bmish
bmish enabled auto-merge (squash) July 11, 2026 16:06
@bmish
bmish requested a review from aladdin-add July 12, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant