-
Notifications
You must be signed in to change notification settings - Fork 75
Description
Rule details
Rule to disallow empty definitions
What type of rule is this?
Warns about a potential problem
Example code
<!-- OK -->
[earth]: https://example.com/earth/ // Valid
<!-- ERROR -->
[earth]: <> // Error
[earth]: // Error
Participation
- I am willing to submit a pull request to implement this rule.To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Additional comments
Hello,
I'd like to propose a new rule called no-empty-definitions
.
This suggestion arose while I was working on a PR for the no-empty-images
rule.
(Reference: #357 (comment))
Currently, the remark-lint-no-empty-url
rule handles a mix of different concerns — specifically no-empty-links
, no-empty-images
, and no-empty-definitions
.
no-empty-links
is already implemented in@eslint/markdown
no-empty-images
is currently under developmentno-empty-definitions
is what I’m proposing here
Initially, I considered unifying these into a single rule, such as no-empty-urls
. However, doing so would likely require merging no-empty-links
into it as well, since their logic would overlap. This, in turn, could introduce a breaking change.
To avoid that, I’d like to suggest creating a separate rule specifically for empty definitions: no-empty-definitions
. This approach keeps the responsibilities clearly separated and avoids introducing any breaking changes to existing rules.
If this suggestion is accepted, I’d be happy if you could assign it to me! I’ll make sure to complete it by May 14.
Metadata
Metadata
Assignees
Type
Projects
Status
Activity
no-empty-images
#357nzakas commentedon May 5, 2025
I think this makes sense. 👍
Pixel998 commentedon May 5, 2025
@nzakas Since @lumirlumir is already covering the other two rules, would you mind if I take on this one?
nzakas commentedon May 5, 2025
That's up to @lumirlumir.
lumirlumir commentedon May 6, 2025
@Pixel998
If you'd prefer to take it, feel free — I'm happy to step aside.
But please note that
[earth]:
would be recognized as a normaltext
node, not adefinition
node. So, we need to handle this situation. ASTPixel998 commentedon May 6, 2025
Thanks @lumirlumir! I will keep this in mind.