Skip to content

Rule Change: Add allowDefinitions option to no-empty-definitions for intentional empty definitions #436

Open
@TKDev7

Description

@TKDev7

What rule do you want to change?

no-empty-definitions

What change do you want to make?

Generate fewer warnings

How do you think the change should be implemented?

A new option

Example code

<!-- eslint markdown/no-empty-definitions: ["error", { allowDefinitions: ["//", "comment"] }] -->

[//]: # (This is a comment)      <!-- allowed, not reported -->
[comment]: # (Another comment)   <!-- allowed, not reported -->
[foo]: #                         <!-- still reported as empty -->

What does the rule currently do for this code?

Reports all empty definitions as errors, including [//]: # (This is a comment) and [comment]: # (Another comment).

What will the rule do after it's changed?

Will not report empty definitions whose label is in the allowDefinitions array (e.g., [//]: # (This is a comment)).

Participation

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

Additional comments

This change will help users who use Markdown comments or placeholders

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Ready to Implement

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions