textlint-filter-rule-whitelist
Advanced tools
Weekly downloads
Changelog
2.0.0
Potentially, allow
behavior is changed by this major update.
For example, you want to ginore following pattern: /#.*{#[a-z.-]+}/
.
allow
pattern:
["/#.*{#[a-z.-]+}/"]
text:
# First {#first}
# Second {#second}
results:
This pattern match only first item({#first}
).
allow
pattern:
["/#.*{#[a-z.-]+}/"]
text:
# First {#first}
# Second {#second}
results:
This pattern match all items({#first}
and {#second}
).
2.0.0 treat allow
pattern as RegExp with global
flag.
Readme
textlint filter rule that filter any word by white list.
Install with npm:
npm install textlint-filter-rule-whitelist
Via .textlintrc
(Recommended)
{
"filters": {
"whitelist": {
"allow": [
"ignored-word",
"/\\d{4}-\\d{2}-\\d{2}/",
"/===IGNORE===[\\s\\S]*?===\/IGNORE===/m"
]
}
}
}
allow
: string[]
whitelistConfigPaths
: string[]
.textlintrc
.For example, you can specify whitelistConfigPaths
to .textlintrc
.
{
"filters": {
"whitelist": {
"whitelistConfigPaths": [
"./allow.json",
"./allow.yml"
]
}
}
}
These files should be following formats.
allow.json
:
[
"ignore-word",
"/yes/i"
]
allow.yml
:
- "ignore-word",
- /yes/i
This filter rule support RegExp-like String.
RegExp-like String is that started with /
and ended with /
or /flag
.
:warning: Yous should escape special characters like \d
in string literal.
/\d/
should be "\\d"
.
For example, you want to ignore /\d{4}-\d{2}-\d{2}/
pattern, you can write allow
as follows:
[
"/\\d{4}-\\d{2}-\\d{2}/"
]
Some textlint rule has false-positive about unique noun. You want to ignore the error about unique noun.
For example, you want to ignore error about /github/i
, you can write allow
as follows:
allow.json
:
[
"/github/i`
]
You want to ignore error between ===IGNORE===
mark.
allow.json
:
[
"/===IGNORE===[\\s\\S]*?===/IGNORE===/m`
]
text:
ERROR Text => actual error
===IGNORE===
ERROR Text => it is ignored!
===/IGNORE===
ERROR Text => actual error
For more information, see textlint/regexp-string-matcher – Example
See Releases page.
Install devDependencies and Run npm test
:
npm i -d && npm test
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
MIT © azu
FAQs
textlint filter rule that filter any word by white list.
The npm package textlint-filter-rule-whitelist receives a total of 412 weekly downloads. As such, textlint-filter-rule-whitelist popularity was classified as not popular.
We found that textlint-filter-rule-whitelist demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.