Project: remarkjs/remark-message-control

Package: remark-message-control@7.0.0

  1. Dependents: 14
  2. remark plugin to enable, disable, and ignore messages with remark
  1. remark 190
  2. unified 174
  3. plugin 137
  4. markdown 131
  5. mdast 85
  6. remark-plugin 73
  7. marker 13
  8. comment 8
  9. message 8
  10. control 3


Build Coverage Downloads Size Sponsors Backers Chat

remark plugin to enable, disable, and ignore messages.


This plugin is ready for the new parser in remark (remarkjs/remark#536). No change is needed: it works exactly the same now as it did before!


This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.


npm install remark-message-control


Say we have the following file, example.md:

<!--foo ignore-->

## Heading

And our script, example.js, looks as follows:

import {readSync} from 'to-vfile'
import {reporter} from 'vfile-reporter'
import remark from 'remark'
import control from 'remark-message-control'

const file = readSync('example.md')

  .use(() => (tree, file) => {
    file.message('Whoops!', tree.children[1], 'foo:thing')
  .use(control, {name: 'foo'})
  .then((file) => {

Now, running node example yields:

example.md: no issues found


This package exports no identifiers. The default export is remarkMessageControl.

unified().use(remarkMessageControl, options)

Let comment markers control messages from a certain sources.


Name of markers that can control the message sources (string).

For example, {name: 'alpha'} controls alpha markers:

<!--alpha ignore-->

List of allowed ruleIds (Array.<string>, optional). When given, a warning is shown when someone tries to control an unknown rule.

For example, {name: 'alpha', known: ['bravo']} results in a warning if charlie is configured:

<!--alpha ignore charlie-->

Whether to treat all messages as turned off initially (boolean, default: false).


List of ruleIds to initially turn on if reset: true (Array.<string>, optional). By default (reset: false), all rules are turned on.


List of ruleIds to turn on if reset: false (Array.<string>, optional).


Sources that can be controlled with name markers (string or Array.<string>, default: options.name).



The disable keyword turns off all messages of the given rule identifiers. When without identifiers, all messages are turned off.

For example, to turn off certain messages:

<!--lint disable list-item-bullet-indent strong-marker-->

*   **foo**

A paragraph, and now another list.

  * __bar__

The enable keyword turns on all messages of the given rule identifiers. When without identifiers, all messages are turned on.

For example, to enable certain messages:

<!--lint enable strong-marker-->

**foo** and __bar__.

The ignore keyword turns off all messages of the given ruleIds occurring in the following node. When without ruleIds, all messages are ignored.

After the end of the following node, messages are turned on again.

For example, to turn off certain messages for the next node:

<!--lint ignore list-item-bullet-indent strong-marker-->

*   **foo**
  * __bar__


Use of remark-message-control does not involve rehype (hast) or user content so there are no openings for cross-site scripting (XSS) attacks. Messages may be hidden from user content though, causing builds to fail or pass, or changing a report.


See contributing.md in remarkjs/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.


MIT © Titus Wormer