A remark-lint
plugin to filter messages in a vFile
from other linters.
It uses https://github.com/isaacs/minimatch.
This plugin filter vFile
messages based on a calculated id.
The id includes the filename, the rule name and the location of the message and optional an additional parameter defined by optionName
.
Format:
`${name}:${source}:${ruleId}[:${message[optionName]}]`
Example:
docs/path/filename.md:179:1-179:21:remark-lint:no-multiple-toplevel-headings
An array of matcher
to remove messages
An array of matcher
to keep messages (evaluated only after a match with deny
)
An array of string to remove from the path of the calculated id
A string for a property of the message appended to the id.
Always check the globstring
against id
and if this matched the second parameter check with parameter message.message
, function check with parameter message
- matcher :=
string
- matcher :=
[string [, (string|regexp|function)]]
A matcher can be one of these combinations:
- Type 1:
matcher
:=globString
- Type 2:
matcher
:= [globString
] - Type 3:
matcher
:= [globString
,regexpString
] - Type 4:
matcher
:= [globString
,regexp
] - Type 5:
matcher
:= [globString
,function
]
With these options:
globString
: a minimatch glob string.regexpString
: a string which would converted to aRegExp.
Used likenew RegExp(regexpString,'i').test(message.message)
.rexexp
: aRegExp
called with parameterregexp.test(message.message)
.function
: a function called with parameterfunction(message)
.
Example configuration:
[
"vfile-message-control",
{
"deny":[
"docs/docs/headless-cms-1.md:*:retext-repeated-words:*",
["docs/docs/README.md:remark-lint:retext-repeated-words:*", '^The parameter'],
],
"allow": [
"docs/docs/headless-cms-1.md:*:retext-repeated-words:graphql",
],
}
]
It uses the debug
package, so you can enable the logs with
DEBUG=vfile-message-control remark
It not removes messages from plugins which attach to FileSet with fileSet.use()
like remark-validate-links
.