{"id":13787638,"url":"https://github.com/remarkjs/remark-message-control","last_synced_at":"2025-06-10T21:19:42.274Z","repository":{"id":46134554,"uuid":"51001261","full_name":"remarkjs/remark-message-control","owner":"remarkjs","description":"plugin to enable, disable, and ignore messages","archived":false,"fork":false,"pushed_at":"2023-09-22T14:50:57.000Z","size":143,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-12T01:35:35.886Z","etag":null,"topics":["markdown","message","remark","remark-plugin"],"latest_commit_sha":null,"homepage":"https://remark.js.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remarkjs.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"unifiedjs","open_collective":"unified"}},"created_at":"2016-02-03T13:26:26.000Z","updated_at":"2023-02-25T11:44:49.000Z","dependencies_parsed_at":"2024-06-18T16:50:44.838Z","dependency_job_id":"bb260dfe-99bc-458a-9371-f4dc4abfe7a8","html_url":"https://github.com/remarkjs/remark-message-control","commit_stats":{"total_commits":121,"total_committers":3,"mean_commits":"40.333333333333336","dds":"0.024793388429752095","last_synced_commit":"16841e3a8052b8c6d36bd4f97550dfc45fe0e574"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-message-control","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-message-control/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-message-control/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-message-control/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remarkjs","download_url":"https://codeload.github.com/remarkjs/remark-message-control/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-message-control/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259152790,"owners_count":22813227,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["markdown","message","remark","remark-plugin"],"created_at":"2024-08-03T21:00:23.164Z","updated_at":"2025-06-10T21:19:42.249Z","avatar_url":"https://github.com/remarkjs.png","language":"JavaScript","funding_links":["https://github.com/sponsors/unifiedjs","https://opencollective.com/unified"],"categories":["CLI"],"sub_categories":["Special comments"],"readme":"\u003c!--lint disable no-html--\u003e\n\n# remark-message-control\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n[![Sponsors][sponsors-badge]][collective]\n[![Backers][backers-badge]][collective]\n[![Chat][chat-badge]][chat]\n\n**[remark][]** plugin to enable, disable, and ignore messages with comments.\n\n## Contents\n\n*   [What is this?](#what-is-this)\n*   [When should I use this?](#when-should-i-use-this)\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`unified().use(remarkMessageControl, options)`](#unifieduseremarkmessagecontrol-options)\n    *   [`Options`](#options)\n*   [Syntax](#syntax)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Security](#security)\n*   [Related](#related)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis package is a [unified][] ([remark][]) plugin that lets authors write\ncomments in markdown to show and hide messages.\n\n## When should I use this?\n\nYou can use this package when you’re building a linter such as\n[`remark-lint`][remark-lint].\nBut you probably don’t need to, because `remark-lint` already exists and it uses\nthis package.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install remark-message-control\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport remarkMessageControl from 'https://esm.sh/remark-message-control@8'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import remarkMessageControl from 'https://esm.sh/remark-message-control@8?bundle'\n\u003c/script\u003e\n```\n\n## Use\n\nSay we have the following file `example.md`:\n\n```markdown\n\u003c!--foo ignore--\u003e\n\n## Neptune\n```\n\n…and a module `example.js`:\n\n```js\n/**\n * @typedef {import('mdast').Root} Root\n */\n\nimport {remark} from 'remark'\nimport remarkMessageControl from 'remark-message-control'\nimport {read} from 'to-vfile'\nimport {reporter} from 'vfile-reporter'\n\nconst file = await remark()\n  .use(function () {\n    /** @param {Root} tree */\n    return function (tree, file) {\n      file.message('Whoops!', {\n        place: tree.children[1]?.position,\n        ruleId: 'thing',\n        source: 'foo'\n      })\n    }\n  })\n  .use(remarkMessageControl, {name: 'foo'})\n  .process(await read('example.md'))\n\nconsole.error(reporter(file))\n```\n\n…then running `node example.js` yields:\n\n```markdown\nexample.md: no issues found\n```\n\n\u003e 👉 **Note**: without `remarkMessageControl`, we’d see:\n\u003e\n\u003e ```txt\n\u003e example.md\n\u003e 3:1-3:11 warning Whoops! thing foo\n\u003e\n\u003e ⚠ 1 warning\n\u003e ```\n\n## API\n\nThis package exports no identifiers.\nThe default export is [`remarkMessageControl`][api-remark-message-control].\n\n### `unified().use(remarkMessageControl, options)`\n\nEnable, disable, and ignore messages with comments.\n\n###### Parameters\n\n*   `options` ([`Options`][api-options], **required**)\n    — configuration\n\n###### Returns\n\nTransform ([`Transformer`][unified-transformer]).\n\n### `Options`\n\nConfiguration (TypeScript type).\n\n###### Fields\n\n*   `enable` (`Array\u003cstring\u003e`, optional)\n    — list of `ruleId`s to initially turn on;\n    used if `reset` is `true`\n*   `disable` (`Array\u003cstring\u003e`, optional)\n    — list of `ruleId`s to initially turn off;\n    used if `reset` is not `true`\n*   `known` (`Array\u003cstring\u003e`, optional)\n    — list of allowed `ruleId`s\n*   `name` (`string`, **required**)\n    — name of markers that can control the message sources\n*   `reset` (`boolean`, default: `false`)\n    — whether to treat all messages as turned off initially\n*   `source` (`Array\u003cstring\u003e` or `string`, default: `options.name`)\n    — [sources][vfile-message-fields] that can be controlled with markers\n\n\u003c!--Old name of section--\u003e\n\n\u003ca name=\"markers\"\u003e\u003c/a\u003e\n\n## Syntax\n\nThis plugin looks for comments in markdown (MDX is also supported).\nIf the first word in those comments does not match `options.name`, the comment\nis skipped.\nThe second word is expected to be `disable`, `enable`, or `ignore`.\nFurther words are rule identifiers of messages which are configurated.\n\nIn EBNF, the grammar looks as follows:\n\n\u003cpre\u003e\u003ccode class=language-ebnf\u003e\u003ca id=s-marker href=#s-marker\u003emarker\u003c/a\u003e ::= \u003ca href=#s-identifier\u003eidentifier\u003c/a\u003e \u003ca href=#s-whitespace\u003ewhitespace\u003c/a\u003e+ \u003ca href=#s-keyword\u003ekeyword\u003c/a\u003e \u003ca href=#s-ruleidentifiers\u003eruleIdentifiers\u003c/a\u003e?\n\u003ca id=s-identifier href=#s-identifier\u003eidentifier\u003c/a\u003e ::= \u003ca href=#s-word\u003eword\u003c/a\u003e+ /* restriction: must match `options.name` */\n\u003ca id=s-keyword href=#s-keyword\u003ekeyword\u003c/a\u003e ::= 'enable' | 'disable' | 'ignore'\n\u003ca id=s-ruleidentifiers href=#s-ruleidentifiers\u003eruleIdentifiers\u003c/a\u003e ::= \u003ca href=#s-word\u003eword\u003c/a\u003e+ (\u003ca href=#s-whitespace\u003ewhitespace\u003c/a\u003e+ \u003ca href=#s-word\u003eword\u003c/a\u003e+)*\n\u003ca id=s-whitespace href=#s-whitespace\u003ewhitespace\u003c/a\u003e ::= ' ' | '\\t' | '\\r' | '\\n' | '\\f'\n\u003ca id=s-word href=#s-word\u003eword\u003c/a\u003e ::= \u003ca href=#s-letter\u003eletter\u003c/a\u003e | \u003ca href=#s-digit\u003edigit\u003c/a\u003e | \u003ca href=#s-punctuation\u003epunctuation\u003c/a\u003e\n\u003ca id=s-letter href=#s-letter\u003eletter\u003c/a\u003e ::= \u003ca href=#s-letterlowercase\u003eletterLowercase\u003c/a\u003e | \u003ca href=#s-letteruppercase\u003eletterUppercase\u003c/a\u003e\n\u003ca id=s-punctuation href=#s-punctuation\u003epunctuation\u003c/a\u003e ::= '-' | '_'\n\u003ca id=s-letterlowercase href=#s-letterlowercase\u003eletterLowercase\u003c/a\u003e ::= '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'\n\u003ca id=s-letteruppercase href=#s-letteruppercase\u003eletterUppercase\u003c/a\u003e ::= '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'\n\u003ca id=s-digit href=#s-digit\u003edigit\u003c/a\u003e ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'\n\u003c/code\u003e\u003c/pre\u003e\n\nWhich keyword is used defines how messages with those rule identifiers are\nhandled:\n\n###### `disable`\n\nThe **disable** keyword turns off all messages of the given rule identifiers.\nWhen without identifiers, all messages are turned off.\n\nFor example, to turn off certain messages:\n\n```markdown\n\u003c!--lint disable list-item-bullet-indent strong-marker--\u003e\n\n*   **foo**\n\nA paragraph, and now another list.\n\n  * __bar__\n```\n\n###### `enable`\n\nThe **enable** keyword turns on all messages of the given rule identifiers.\nWhen without identifiers, all messages are turned on.\n\nFor example, to enable certain messages:\n\n```markdown\n\u003c!--lint enable strong-marker--\u003e\n\n**foo** and __bar__.\n```\n\n###### `ignore`\n\nThe **ignore** keyword turns off all messages of the given `ruleId`s occurring\nin the following node.\nWhen without `ruleId`s, all messages are ignored.\n\nMessages are turned on again after the end of the following node.\n\nFor example, to turn off certain messages for the next node:\n\n```markdown\n\u003c!--lint ignore list-item-bullet-indent strong-marker--\u003e\n\n*   **foo**\n  * __bar__\n```\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the additional type [`Options`][api-options].\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line, `remark-message-control@^8`,\ncompatible with Node.js 16.\n\nThis plugin works with `unified` version 6+ and `remark` version 7+.\n\n## Security\n\nUse of `remark-message-control` does not involve **[rehype][]** (**[hast][]**)\nor user content so there are no openings for [cross-site scripting\n(XSS)][wiki-xss] attacks.\nMessages may be hidden from user content though, causing builds to fail or pass,\nor changing a report.\n\n## Related\n\n*   [`remark-lint`][remark-lint]\n    — plugin to lint code style\n*   [`mdast-comment-marker`](https://github.com/syntax-tree/mdast-comment-marker)\n    — mdast utility to parse comment markers\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`remarkjs/.github`][health] for ways\nto get started.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organization, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n\u003c!-- Definitions --\u003e\n\n[build-badge]: https://github.com/remarkjs/remark-message-control/workflows/main/badge.svg\n\n[build]: https://github.com/remarkjs/remark-message-control/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/remarkjs/remark-message-control.svg\n\n[coverage]: https://codecov.io/github/remarkjs/remark-message-control\n\n[downloads-badge]: https://img.shields.io/npm/dm/remark-message-control.svg\n\n[downloads]: https://www.npmjs.com/package/remark-message-control\n\n[size-badge]: https://img.shields.io/bundlejs/size/remark-message-control\n\n[size]: https://bundlejs.com/?q=remark-message-control\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[collective]: https://opencollective.com/unified\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/remarkjs/remark/discussions\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[health]: https://github.com/remarkjs/.github\n\n[contributing]: https://github.com/remarkjs/.github/blob/main/contributing.md\n\n[support]: https://github.com/remarkjs/.github/blob/main/support.md\n\n[coc]: https://github.com/remarkjs/.github/blob/main/code-of-conduct.md\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[hast]: https://github.com/syntax-tree/hast\n\n[rehype]: https://github.com/rehypejs/rehype\n\n[remark]: https://github.com/remarkjs/remark\n\n[remark-lint]: https://github.com/remarkjs/remark-lint\n\n[typescript]: https://www.typescriptlang.org\n\n[unified]: https://github.com/unifiedjs/unified\n\n[unified-transformer]: https://github.com/unifiedjs/unified#transformer\n\n[vfile-message-fields]: https://github.com/vfile/vfile-message#fields\n\n[wiki-xss]: https://en.wikipedia.org/wiki/Cross-site_scripting\n\n[api-options]: #options\n\n[api-remark-message-control]: #unifieduseremarkmessagecontrol-options\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkjs%2Fremark-message-control","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremarkjs%2Fremark-message-control","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkjs%2Fremark-message-control/lists"}