1.1.0 • Published 8 years ago

textlint-rule-ignore-comments v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

textlint-rule-ignore-comments Build Status

textlint rule that ignore texts using comments directive.

Install

Install with npm:

npm install textlint-rule-ignore-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.

Limitation(markdown):

Require new-line around of <!-- textlint-disable --> in Markdown.

NG:

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

OK:

<!-- textlint-disable -->

this is ok

<!-- textlint-enable -->

Settings

Via .textlintrc(Recommended)

{
    "rules": {
        "ignore-comments": true
    }
}

Via CLI

textlint --rule ignore-comments README.md

Options

  • enablingComment:
    • default: "textlint-enable"
    • enable comment directive
    • e.g.) <!-- textlint-enable -->
  • disablingComment:
    • default: "textlint-disable"
    • disable comment directive
    • e.g.) <!-- textlint-disable -->
{
    "rules": {
        "ignore-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