https://github.com/textlint/textlint-filter-rule-comments
textlint filter rule that disables all rules between comments directive.
https://github.com/textlint/textlint-filter-rule-comments
comment disable filter ignore supress textlintrule
Last synced: 4 months ago
JSON representation
textlint filter rule that disables all rules between comments directive.
- Host: GitHub
- URL: https://github.com/textlint/textlint-filter-rule-comments
- Owner: textlint
- License: mit
- Created: 2016-05-07T12:18:59.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-12-14T04:32:39.000Z (over 1 year ago)
- Last Synced: 2025-12-07T05:43:39.054Z (5 months ago)
- Topics: comment, disable, filter, ignore, supress, textlintrule
- Language: JavaScript
- Homepage:
- Size: 121 KB
- Stars: 36
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# textlint-filter-rule-comments [](https://github.com/textlint/textlint-filter-rule-comments/actions?query=workflow%3A"test")
textlint rule that ignore error using comments directive.
## Install
Install with [npm](https://www.npmjs.com/):
npm install textlint-filter-rule-comments
Dependencies:
- [textlint](http://textlint.github.io/ "textlint") >= 6.9
## Usage
### Ignore error messages using comments
Example case in Markdown.
```markdown
This is error text.
This is ignored text by rule.
Disables all rules between comments
This is error text.
```
Ignore specified rules:
```markdown
Ignore RuleA and RuleB
Still ignore RuleB
```
**Limitation(markdown)**:
Require new-line around of `` in Markdown.
This limitation com from [remark](https://github.com/wooorm/remark "remark").
NG:
```markdown
this is wrong
```
OK:
```markdown
this is ok
```
### Settings
Via `.textlintrc`(Recommended)
```json
{
"filters": {
"comments": true
}
}
```
### Options
- `enablingComment`:
- default: `"textlint-enable"`
- enable comment directive
- e.g.) ``
- `disablingComment`:
- default: `"textlint-disable"`
- disable comment directive
- e.g.) ``
```js
{
"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](https://github.com/textlint/textlint-filter-rule-comments/releases).
## Acknowledgement
- [Documentation - ESLint - Pluggable JavaScript linter](http://eslint.org/docs/user-guide/configuring#disabling-rules-with-inline-comments "Documentation - ESLint - Pluggable JavaScript linter")
## 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](https://github.com/textlint/textlint-filter-rule-comments/issues).
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
- [github/azu](https://github.com/azu)
- [twitter/azu_re](http://twitter.com/azu_re)
## License
MIT © azu