Skip to content

Enhance AGENTS.md guidance for typed tests and ESLint suppressions #1419

Description

@coderabbitai

Summary

Enhance AGENTS.md so agents do not add blanket ESLint suppression entries when they add or modify tests with many @typescript-eslint/no-explicit-any violations.

Rationale

AGENTS.md already states that suppression counts must not increase and that new code must use typed test doubles or unknown guards instead of any. The guidance needs a concrete workflow for large test files. This will make the rule easier to apply during implementation and review.

Affected area

  • AGENTS.md
  • Test files that use @typescript-eslint/no-explicit-any suppression counts in src/eslint-suppressions.json

Required changes

  • Add a concise test-typing checklist for new and substantially changed test files.
  • Require typed structural doubles, typed mock helpers, or unknown plus type guards before a suppression is considered.
  • Prohibit adding a new per-file no-explicit-any suppression entry for a new test file.
  • Require a narrow ESLint command with --prune-suppressions after test typing changes.
  • State that an unavoidable exception requires a local explanation and maintainer approval.

Acceptance criteria

  • AGENTS.md contains the new checklist and exception process.
  • The text does not conflict with the existing ESLint Suppressions section.
  • The change does not increase any count in src/eslint-suppressions.json.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions