Gathering detailed insights and metrics for remark-message-control
Gathering detailed insights and metrics for remark-message-control
Gathering detailed insights and metrics for remark-message-control
Gathering detailed insights and metrics for remark-message-control
npm install remark-message-control
Typescript
Module System
Node Version
NPM Version
97.2
Supply Chain
99.4
Quality
79.7
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
8 Stars
121 Commits
2 Forks
8 Watchers
1 Branches
14 Contributors
Updated on Feb 25, 2023
Latest Version
8.0.0
Package Id
remark-message-control@8.0.0
Unpacked Size
14.99 kB
Size
5.56 kB
File Count
7
NPM Version
9.8.0
Node Version
20.5.1
Published on
Sep 22, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
remark plugin to enable, disable, and ignore messages with comments.
This package is a unified (remark) plugin that lets authors write comments in markdown to show and hide messages.
You can use this package when you’re building a linter such as
remark-lint
.
But you probably don’t need to, because remark-lint
already exists and it uses
this package.
This package is ESM only. In Node.js (version 16+), install with npm:
1npm install remark-message-control
In Deno with esm.sh
:
1import remarkMessageControl from 'https://esm.sh/remark-message-control@8'
In browsers with esm.sh
:
1<script type="module"> 2 import remarkMessageControl from 'https://esm.sh/remark-message-control@8?bundle' 3</script>
Say we have the following file example.md
:
1<!--foo ignore--> 2 3## Neptune
…and a module example.js
:
1/** 2 * @typedef {import('mdast').Root} Root 3 */ 4 5import {remark} from 'remark' 6import remarkMessageControl from 'remark-message-control' 7import {read} from 'to-vfile' 8import {reporter} from 'vfile-reporter' 9 10const file = await remark() 11 .use(function () { 12 /** @param {Root} tree */ 13 return function (tree, file) { 14 file.message('Whoops!', { 15 place: tree.children[1]?.position, 16 ruleId: 'thing', 17 source: 'foo' 18 }) 19 } 20 }) 21 .use(remarkMessageControl, {name: 'foo'}) 22 .process(await read('example.md')) 23 24console.error(reporter(file))
…then running node example.js
yields:
1example.md: no issues found
👉 Note: without
remarkMessageControl
, we’d see:1example.md 23:1-3:11 warning Whoops! thing foo 3 4⚠ 1 warning
This package exports no identifiers.
The default export is remarkMessageControl
.
unified().use(remarkMessageControl, options)
Enable, disable, and ignore messages with comments.
options
(Options
, required)
— configurationTransform (Transformer
).
Options
Configuration (TypeScript type).
enable
(Array<string>
, optional)
— list of ruleId
s to initially turn on;
used if reset
is true
disable
(Array<string>
, optional)
— list of ruleId
s to initially turn off;
used if reset
is not true
known
(Array<string>
, optional)
— list of allowed ruleId
sname
(string
, required)
— name of markers that can control the message sourcesreset
(boolean
, default: false
)
— whether to treat all messages as turned off initiallysource
(Array<string>
or string
, default: options.name
)
— sources that can be controlled with markersThis plugin looks for comments in markdown (MDX is also supported).
If the first word in those comments does not match options.name
, the comment
is skipped.
The second word is expected to be disable
, enable
, or ignore
.
Further words are rule identifiers of messages which are configurated.
In EBNF, the grammar looks as follows:
1[object Object], ::= ,[object Object], ,[object Object],+ ,[object Object], ,[object Object],? 2,[object Object], ::= ,[object Object],+ /* restriction: must match `options.name` */ 3,[object Object], ::= 'enable' | 'disable' | 'ignore' 4,[object Object], ::= ,[object Object],+ (,[object Object],+ ,[object Object],+)* 5,[object Object], ::= ' ' | '\t' | '\r' | '\n' | '\f' 6,[object Object], ::= ,[object Object], | ,[object Object], | ,[object Object], 7,[object Object], ::= ,[object Object], | ,[object Object], 8,[object Object], ::= '-' | '_' 9,[object Object], ::= 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z' 10,[object Object], ::= 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z' 11,[object Object], ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
Which keyword is used defines how messages with those rule identifiers are handled:
disable
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:
1<!--lint disable list-item-bullet-indent strong-marker--> 2 3* **foo** 4 5A paragraph, and now another list. 6 7 * __bar__
enable
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:
1<!--lint enable strong-marker--> 2 3**foo** and __bar__.
ignore
The ignore keyword turns off all messages of the given ruleId
s occurring
in the following node.
When without ruleId
s, all messages are ignored.
Messages are turned on again after the end of the following node.
For example, to turn off certain messages for the next node:
1<!--lint ignore list-item-bullet-indent strong-marker--> 2 3* **foo** 4 * __bar__
This package is fully typed with TypeScript.
It exports the additional type Options
.
Projects maintained by the unified collective are compatible with maintained versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line, remark-message-control@^8
,
compatible with Node.js 16.
This plugin works with unified
version 6+ and remark
version 7+.
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.
remark-lint
— plugin to lint code stylemdast-comment-marker
— mdast utility to parse comment markersSee 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.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
Found 1/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More