npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

textlint-filter-rule-allowlist

v4.0.0

Published

textlint filter rule that filters any word by allowing lists.

Downloads

94,249

Readme

textlint-filter-rule-allowlist

textlint filter rule that filters any word by allowing lists.

Install

Install with npm:

npm install textlint-filter-rule-allowlist

Usage

Via .textlintrc(Recommended)

{
    "filters": {
        "allowlist": {
            "allow": [
                "ignored-word",
                "/\\d{4}-\\d{2}-\\d{2}/",
                "/===IGNORE===[\\s\\S]*?===\/IGNORE===/m"
            ]
        }
    }
}

Options

  • allow: string[]
  • allowlistConfigPaths: string[]
    • File path list that includes allow words.
    • The File path is relative path from your .textlintrc.
    • Support file format: JSON, yml
    • Cannot use when using @textlint/editor

For example, you can specify allowlistConfigPaths to .textlintrc.

{
    "filters": {
        "allowlist": {
            "allowlistConfigPaths": [
                "./allow.json",
                "./allow.yml"
            ]
        }
    }
}

These files should be following formats.

allow.json:

[
  "ignore-word",
  "/yes/i"
]

allow.yml:

- "ignore-word",
- /yes/i

RegExp-like String

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}/"
]

Example: Ignore text by RegExp-like string

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`
]

This rule treat RegExp-like string as /github/ig.. g(global) flag is added by default.

Example: Ignore range

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

Example: Ignore Math extension

You want to ignore math expression($$ math expression $$) in Markdown.

allow.json:

[
  "/\\$\\$[\\s\\S]*?\\$\\$/m"
]

text:

$$
\begin{pmatrix}
1 & 0 & 0 \\\ 
0 & 1 & 0 \\\
0 & 0 & 1
\end{pmatrix}
$$

For more information, see textlint/regexp-string-matcher – Example

Changelog

See Releases page.

Rename: textlint-filter-rule-whitelist to textlint-filter-rule-allowlist

The original name of this filter rule is textlint-filter-rule-whitelist. We have migrated to use textlint-filter-rule-allowlist.

For more details, see following issue.

Running tests

Install devDependencies and Run npm test:

npm i -d && npm test

Contributing

Pull requests and stars are always welcome.

For bugs and feature requests, please create an issue.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

License

MIT © azu