1.1.0 • Published 4 years ago

textlint-filter-rule-node-types v1.1.0

Weekly downloads
161
License
MIT
Repository
github
Last release
4 years ago

textlint-filter-rule-node-types Build Status

textlint filter rule that filter error about specified node type.

Story

You have used various textlint rule. These work fine, but you want to ignore some reported error in your text.

FooRule also check the BlockQuote text, but you want to ignore the BlockQuote text.

textlint-filter-rule-node-types rule resolve the issue.

This is filter rule of textlint.

Installation

npm install textlint-filter-rule-node-types

Dependencies

Usage

If you want to ignore BlockQuote node, define "BlockQuote" to "nodeTypes".

.textlintrc

{
    "filters": {
        "node-types": {
            "nodeTypes": ["BlockQuote"]
        }
    }
}

OR

.textlintrc as JavaScript config file.

const TextLintNodeType = require("textlint").TextLintNodeType;
module.exports = {
    "filters": {
        "node-types": {
            "nodeTypes": [TextLintNodeType.BlockQuote]
        }
    }
}

If you want to know all types of TxtNode, please see the document.

Tests

npm test

Knowledge

ESLint have a feature like Disabling comment.

textlint not define file syntax. For example, Markdown format have not comment syntax(have only html comment).

We can resolve the issue by the ignoring rule instead of disabling comment.

Of course, disabling comment could be implemented as ignoring rule.

Related

Opposite <-> textlint-rule-report-node-types.

Contributing

  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

License

MIT