Skip to content

Conversation

@StyleShit
Copy link

Closes #368

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new ESLint rule no-matching-violation-suggest-message-ids that enforces suggestions to have different messageIds than their parent report violations. This helps ensure that suggestion messages are actionable and distinct from the main violation message.

Key Changes:

  • Introduced the new rule implementation with support for static and dynamic messageId detection
  • Added comprehensive test coverage for various scenarios including conditional expressions and external variables
  • Extended utility functions to support string literal type checking

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/rules/no-matching-violation-suggest-message-ids.ts Implements the core rule logic for detecting matching messageIds between violations and suggestions
tests/lib/rules/no-matching-violation-suggest-message-ids.ts Provides comprehensive test cases covering valid and invalid scenarios
lib/utils.ts Adds isStringLiteral utility function for type checking
lib/types.ts Defines StringLiteral type for type-safe string literal handling
lib/index.ts Registers the new rule in the plugin's rule registry
docs/rules/no-matching-violation-suggest-message-ids.md Documents the rule with examples and usage guidance
README.md Updates the rules table to include the new rule

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

Rule: require suggestions have different messageId than their parent report

1 participant