Skip to content
textlint filter rule that disables all rules between comments directive.
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src fix: allow to use multiple comment Dec 25, 2016
test fix: allow to use multiple comment Dec 25, 2016
.babelrc initial commit May 7, 2016
.gitignore initial commit May 7, 2016
.travis.yml initial commit May 7, 2016
LICENSE initial commit May 7, 2016
README.md Fixes #5: Updated sample code for Options in README.md (#6) Oct 5, 2016
package.json 1.2.2 Dec 25, 2016

README.md

textlint-filter-rule-comments Build Status

textlint rule that ignore error using comments directive.

Install

Install with npm:

npm install textlint-filter-rule-comments

Dependencies:

Usage

Ignore error messages using comments

Example case in Markdown.

This is error text.

<!-- textlint-disable -->

This is ignored text by rule.
Disables all rules between comments

<!-- textlint-enable -->

This is error text.

Ignore specified rules:

<!-- textlint-disable ruleA,ruleB -->

Ignore RuleA and RuleB

<!-- textlint-enable ruleA -->

Still ignore RuleB

Limitation(markdown):

Require new-line around of <!-- textlint-disable --> in Markdown. This limitation com from remark.

NG:

<!-- textlint-disable -->
this is wrong
<!-- textlint-enable -->

OK:

<!-- textlint-disable -->

this is ok

<!-- textlint-enable -->

Settings

Via .textlintrc(Recommended)

{
    "filters": {
        "comments": true
    }
}

Options

  • enablingComment:
    • default: "textlint-enable"
    • enable comment directive
    • e.g.) <!-- textlint-enable -->
  • disablingComment:
    • default: "textlint-disable"
    • disable comment directive
    • e.g.) <!-- textlint-disable -->
{
    "filters": {
        "comments": {
            // enable comment directive
            // if comment has the value, then enable textlint rule
            "enablingComment": "textlint-enable",
            // disable comment directive
            // if comment has the value, then disable textlint rule
           "disablingComment": "textlint-disable"
        }
    }
}

Changelog

See Releases page.

Acknowledgement

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

You can’t perform that action at this time.