Skip to content

Conversation

juhwano
Copy link
Contributor

@juhwano juhwano commented Aug 11, 2025

Prerequisites checklist

What is the purpose of this pull request?

This pull request updates the no-duplicate-definitions rule to include the specific identifier in its error messages. This change helps developers quickly locate the specific definition causing the issue.

What changes did you make? (Give an overview)

  • Updated the meta.messages of no-duplicate-definitions to include the {{ identifier }} placeholder.
  • Updated the create function in the rule to pass the identifier through the data property in context.report().
  • Updated the tests for the rule to verify that the identifier is correctly passed in invalid cases.

Related Issues

fixes #499

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

Copy link
Member

@lumirlumir lumirlumir 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!

Would like another review before merging, since it's a small change but adds a new feature.

duplicateFootnoteDefinition:
"Unexpected duplicate footnote definition found.",
"Unexpected duplicate footnote definition `{{ identifier }}` found.",
Copy link
Member

Choose a reason for hiding this comment

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

To the team: I think using backticks here would be fine, since the similar rule no-unused-definition uses backticks as well.

"Unexpected unused footnote definition `{{ identifier }}` found.",

@lumirlumir lumirlumir moved this from Needs Triage to Second Review Needed in Triage Aug 12, 2025
Copy link
Member

@nzakas nzakas 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.

@nzakas nzakas merged commit 9f54c1b into eslint:main Aug 19, 2025
23 of 24 checks passed
@github-project-automation github-project-automation bot moved this from Second Review Needed to Complete in Triage Aug 19, 2025
@injae-kim
Copy link

Awesome work @juhwano 🎉 🎉 🎉

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.

Rule Change: Expose identifiers in the message for the no-*-definitions rule
4 participants