The pluggable natural language linter for text and markdown.
MIT License
Bot releases are visible (Hide)
$ textlint "*pattern"
(need to wrap "
)
textlint "./docs/"
# Results
[ 'docs/configuring.md',
'docs/faq/failed-to-load-textlints-module.md',
'docs/faq/line-column-or-index.md',
'docs/filter-rule.md',
'docs/formatter.md',
'docs/getting-started.md',
'docs/plugin.md',
'docs/README.md',
'docs/rule-advanced.md',
'docs/rule-fixable.md',
'docs/rule-preset.md',
'docs/rule.md',
'docs/txtnode.md',
'docs/use-as-modules.md' ]
textlint "./docs/**"
# Results
[ 'docs/configuring.md',
'docs/faq/failed-to-load-textlints-module.md',
'docs/faq/line-column-or-index.md',
'docs/filter-rule.md',
'docs/formatter.md',
'docs/getting-started.md',
'docs/plugin.md',
'docs/README.md',
'docs/rule-advanced.md',
'docs/rule-fixable.md',
'docs/rule-preset.md',
'docs/rule.md',
'docs/txtnode.md',
'docs/use-as-modules.md' ]
textlint "./docs/faq/*.md"
# Results
[ 'docs/faq/failed-to-load-textlints-module.md',
'docs/faq/line-column-or-index.md' ]
Fixes:
This change also fix following issue.
webpack2 + textlint throw error like this.
ERROR in ./~/rc/index.js
Module parse failed: /Users/azu/.ghq/github.com/textlint/textlint.github.io/node_modules/rc/index.js Unexpected character '#' (1:0)
You may need an appropriate loader to handle this file type.
| #! /usr/bin/env node
| var cc = require('./lib/utils')
| var join = require('path').join
@ ./~/rc-loader/dist/index.js 10:10-23
@ ./~/textlint/lib/config/config-loader.js
@ ./~/textlint/lib/config/config.js
@ ./~/textlint/lib/cli.js
@ ./~/textlint/lib/index.js
@ ./src/components/TextlintDemo/TextlintEditor.js
@ ./src/components/TextlintDemo.js
@ ./src/components/App.js
@ ./src/index.js
Published by azu almost 8 years ago
Published by azu almost 8 years ago
Published by azu almost 8 years ago
Published by azu about 8 years ago
Published by azu over 8 years ago
--experimental
flag of shouldIgnore()
(b1e2a17)Filter rule provide filtering error that is reported by linting rule.
For example, textlint-filter-rule-comments provide filtering function by using comments.
<!-- textlint-disable -->
Disables all rules between comments
<!-- textlint-enable -->`
Allow to short textlint-filter-rule-comments
to comments
.
Add filter rule name to filters
field.
{
"filters": {
"comments": true
}
}
One more example, very-nice-rule
is useful, but you want to ignore some reported error in your text.
very-nice-rule
also check the BlockQuote
text, but you want to ignore the BlockQuote
text.
textlint-filter-rule-node-types rule resolve the issue.
{
"filters": {
"node-types": {
"nodeTypes": ["BlockQuote"]
}
},
"rules": {
"very-nice-rule": true
}
}
See Sharable Configuration for details.
Example : azu/textlint-config-readme: Sharable config for textlint
You can use the config via two step.
npm i -D @azu/textlint-config-readme textlint
$(npm bin)/textlint --config @azu/textlint-config-readme README.md
textlint 7.0 has some breaking change.
It will not affect textlint user, but affect to textlint rule developer.
Duplicated messages is ignored by default.
Duplicated messages is that have same range and same message.
(Not depended on ruleId. ruleId is flexible property)
textlint 7.0 sort message by line and column.
The rule that depended on the order of messages may fail test.
textlint 7.0 not support Node.js 0.12. (But still it work)
Requirement: Node.js 4.0.0 >=
Published by azu over 8 years ago
This is beta release
Please try it :)
npm install textlint@beta
Filter rule provide filtering error that is reported by linting rule.
For example, textlint-filter-rule-comments provide filtering function by using comments.
<!-- textlint-disable -->
Disables all rules between comments
<!-- textlint-enable -->`
Allow to short textlint-filter-rule-comments
to comments
.
Add filter rule name to filters
field.
{
"filters": {
"comments": true
}
}
One more example, very-nice-rule
is useful, but you want to ignore some reported error in your text.
very-nice-rule
also check the BlockQuote
text, but you want to ignore the BlockQuote
text.
textlint-filter-rule-node-types rule resolve the issue.
{
"filters": {
"node-types": {
"nodeTypes": ["BlockQuote"]
}
},
"rules": {
"very-nice-rule": true
}
}
See Sharable Configuration for details.
Example : azu/textlint-config-readme: Sharable config for textlint
You can use the config via two step.
npm i -D @azu/textlint-config-readme textlint
$(npm bin)/textlint --config @azu/textlint-config-readme README.md
textlint 7.0 has some breaking change.
It will not affect textlint user, but affect to textlint rule developer.
Duplicated messages is ignored by default.
Duplicated messages is that have same range and same message.
(Not depended on ruleId. ruleId is flexible property)
textlint 7.0 sort message by line and column.
The rule that depended on the order of messages may fail test.
textlint 7.0 not support Node.js 0.12. (But still it work)
Requirement: Node.js 4.0.0 >=
AST explorer for textlint is useful for understanding AST.
Try to run DEBUG=textlint* textlint README