Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Check messageIds in context.report() #140

Merged
merged 1 commit into from
Jan 3, 2025
Merged

feat: Check messageIds in context.report() #140

merged 1 commit into from
Jan 3, 2025

Conversation

nzakas
Copy link
Member

@nzakas nzakas commented Dec 9, 2024

Prerequisites checklist

What is the purpose of this pull request?

I realized we could easily type check messageId in context.report() if we pass through the MessageIds type from RuleDefinition, so I did that.

What changes did you make? (Give an overview)

Enhancements to RuleContext and related types:

  • Added MessageIds to RuleContextTypeOptions to support custom message identifiers.
  • Simplified the RuleContext interface by using RuleContextTypeOptions directly.
  • Updated the report method in RuleContext to include MessageIds in the ViolationReport type.
  • Enhanced ViolationMessage and ViolationReport types to support custom MessageIds.
  • Included MessageIds in the RuleDefinition context options.

Test updates:

  • Added TestMessageIds type and included it in TestRuleContext to validate the changes in the test suite.

Related Issues

Is there anything you'd like reviewers to focus on?

Copy link
Member

@fasttime fasttime left a comment

Choose a reason for hiding this comment

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

LGTM, thanks. Leaving open for a second review.

Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

😎 nice!

@nzakas nzakas merged commit 1c9ca4d into main Jan 3, 2025
18 checks passed
@nzakas nzakas deleted the type-updates branch January 3, 2025 17:33
@github-actions github-actions bot mentioned this pull request Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

3 participants