Skip to content

New Rule: no-empty-definitions #359

Closed
@lumirlumir

Description

@lumirlumir

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.

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 development
  • no-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

No type

Projects

Status

Complete

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions