Skip to content

Rule Change: Expose identifiers in the message for the no-*-definitions ruleΒ #499

@juhwano

Description

@juhwano

What rule do you want to change?

no-duplicate-definitions, no-empty-definitions

What change do you want to make?

Implement suggestions

How do you think the change should be implemented?

A new default behavior

Example code

1. no-duplicate-definitions
[link-1]: https://example.com
[link-2]: https://example.com/b
[link-1]: https://example.com/a

2. no-empty-definitions
[link-1]: https://example.com
[link-2]: https://example.com/b
[link-3]:

What does the rule currently do for this code?

The rules currently report generic error messages that don't include the specific identifier causing the issue. This makes it difficult for developers to quickly pinpoint and fix the problem.

  1. no-duplicate-definitions: "Unexpected duplicate definition found."
  2. no-empty-definitions: "Unexpected empty definition found.

What will the rule do after it's changed?

The rules will be updated to include the identifier in the reported message, providing more specific and actionable feedback. This will align their behavior with the no-unused-definitions rule.

  1. no-duplicate-definitions: "Unexpected duplicate definition {{ identifier }} found."
  2. no-empty-definitions: "Unexpected empty definition {{ identifier }} found."

Participation

  • I am willing to submit a pull request to implement this change.

Additional comments

No response

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Complete

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions