Skip to content

fix: add missing RequiresTypeInfo meta to 7 typescript-eslint rules#601

Merged
fansenze merged 1 commit intomainfrom
fix/add-requires-type-info-meta-20260407
Apr 7, 2026
Merged

fix: add missing RequiresTypeInfo meta to 7 typescript-eslint rules#601
fansenze merged 1 commit intomainfrom
fix/add-requires-type-info-meta-20260407

Conversation

@fansenze
Copy link
Copy Markdown
Contributor

@fansenze fansenze commented Apr 7, 2026

Summary

7 @typescript-eslint rules use ctx.TypeChecker but were missing RequiresTypeInfo: true in their rule metadata. Without this flag, the linter will run these rules on files without a type checker, which can cause panics or silent no-ops.

Rules fixed:

  • consistent-return
  • no-empty-interface
  • prefer-includes
  • prefer-readonly
  • prefer-regexp-exec
  • restrict-template-expressions
  • switch-exhaustiveness-check

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

The following rules use ctx.TypeChecker but were missing
RequiresTypeInfo: true, which tells the linter to skip them on
files without a type checker:

- consistent-return
- no-empty-interface
- prefer-includes
- prefer-readonly
- prefer-regexp-exec
- restrict-template-expressions
- switch-exhaustiveness-check
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates several TypeScript linting rules, including consistent-return, no-empty-interface, prefer-includes, prefer-readonly, prefer-regexp-exec, restrict-template-expressions, and switch-exhaustiveness-check, by setting the RequiresTypeInfo flag to true. This change ensures that these rules are correctly identified as requiring type information for their execution. I have no feedback to provide.

@fansenze fansenze merged commit c1b2b17 into main Apr 7, 2026
11 checks passed
@fansenze fansenze deleted the fix/add-requires-type-info-meta-20260407 branch April 7, 2026 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant