Package Exports
- textlint
- textlint/lib/config/config
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (textlint) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
textlint 
The pluggable linting tool for text(plain text and markdown).
It is similar to ESLint.
Installation
$ npm install textlint -gUsage

- more more document
$ textlint README.mdCLI
See help.
$ textlint -h
textlint [options] file.md [file.txt] [dir]
Options:
-h, --help Show help.
--rulesdir [path::String] Set rules from this directory and set all default rules to off.
-f, --format String Use a specific output format. - default: stylish
-v, --version Outputs the version number.
--ext [String] Specify text file extensions.
--no-color Enable color in piped output.
-o, --output-file path::String Enable report to be written to a file.
--quiet Report errors only. - default: false
--stdin Lint code provided on <STDIN>. - default: falseBuilt-in formatters
See formatters/.
Currently, you can use "stylish" (defaults), "compact", "checkstyle", "jslint-xml", "junit", "tap", "pretty-error".
e.g.) use pretty-error.js
$ textlint -f pretty-error file.mdUse as node modules
You can use textlint as node modules.
$ npm install textlint --save-devMinimal usage:
var TextLintEngine = require("textlint").TextLintEngine;
var engine = new TextLintEngine({
rulePaths: ["path/to/rule-dir"]
});
var results = engine.executeOnFiles(["README.md"]);
console.log(results[0].filePath);// => "README.md"
console.log(results[0].messages);// => [{message:"lint message"}]
if (engine.isErrorResults(results)) {
var output = engine.formatResults(results);
console.log(output);
}High level usage:
var textlint = require("textlint").textlint;
textlint.setupRules({
// rule-key : rule function(see docs/create-rules.md)
"rule-key": function(context){
var exports = {};
exports[context.Syntax.Str] = function (node) {
context.report(node, new context.RuleError("error message"));
};
return exports;
}
});
var results = cliEngine.executeOnFiles(["README.md"]);
console.log(results[0].filePath);// => "README.md"
console.log(results[0].messages);// => [{message:"lint message"}]More detail:
FAQ: How to create rules?
Please see docs/
- docs/txtnode.md
- What is is TxtNode?
- docs/create-rules.md
- How to create rules?
- Tutorial: creating
no-todorule.
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request :D
License
MIT
and
lib/load-rules.js, util/traverse.js, cli.js and formatters are:
ESLint
Copyright (c) 2013 Nicholas C. Zakas. All rights reserved.
https://github.com/eslint/eslint/blob/master/LICENSERelated Work
SCG: TextLint is similar project.
SCG: TextLint's place is equal to my textlint(Fortuitously, project's name is the same too!).

via Natural Language Checking with Program Checking Tools
Acknowledgements
Thanks to ESLint.