Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
The pluggable linting tool for text(plain text and markdown).
It is similar to ESLint.
$ npm install textlint -g
textlint has not default rule!!
Should use textlint with --rule
or --ruledir
.
:information_source: See examples/cli
# install textlint rule
npm install --save-dev textlint-rule-no-todo
# use with `textlint-rule-no-todo` rule
# shorten `textlint-rule-no-todo` to `no-todo`.
textlint --rule no-todo README.md
See command help.
$ textlint -h
textlint [options] file.md [file.txt] [dir]
Options:
-h, --help Show help.
-c, --config path::String Use configuration from this file or sharable config.
--rule [path::String] Set rule package name and set all default rules to off.
--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: false
Allow to use with multiple rules.
$ textlint --rule no-todo --rule very-nice-rule README.md
.textlintrc
is config file that is loaded as YAML, JSON or JS via MoOx/rc-loader.
$ textlint --rule no-todo --rule very-nice-rule README.md
is equal to
{
"rules": {
"no-todo": true,
"very-nice-rule": true,
}
}
The config object can define rule's option.
{
"rules": {
"no-todo": false, // disable
"very-nice-rule": {
"key": "value"
}
}
}
Pass rule's options("key": "value") to very-nice-rule
.
It mean that use the following format:
{
"rules": {
"<rule-name>": true | false | object
}
}
:information_source: for more details
textlint plugin is a set of rules and rulesConfig or customize parser.
To enable plugin, put the "plugin-nameinto
.textlinrc`.
// `.textlinrc`
{
"plugins": [
"plugin-name"
],
// overwrite-plugins rules config
// <plugin>/<rule>
"rules": {
"plugin-name/rule-name" : false
}
}
:information_source: See docs/plugin.md
See Collection of textlint rule · textlint/textlint Wiki.
If you create new rule, and add it to the wiki :)
Currently, you can use "stylish" (defaults), "compact", "checkstyle", "jslint-xml", "junit", "tap", "pretty-error", "json".
e.g.) use pretty-error.js
$ textlint -f pretty-error file.md
More detail in textlint/textlint-formatter.
You can use textlint as node modules.
$ npm install textlint --save-dev
Minimal 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"
// messages are `TextLintMessage` array.
console.log(results[0].messages);
/*
[
{
id: "rule-name",
message:"lint message",
line: 1, // 1-based columns(TextLintMessage)
column:1 // 1-based columns(TextLintMessage)
}
]
*/
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:
Please see docs/
no-todo
rule.gulp plugin for textlint.
The plugin for Atom Linter provides an interface to textlint.
The vuejs.org for japanese.
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
MIT and
lib/load-rules.js
, util/traverse.js
, cli.js
and timing.js
are:
ESLint
Copyright (c) 2013 Nicholas C. Zakas. All rights reserved.
https://github.com/eslint/eslint/blob/master/LICENSE
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
Many thanks to ESLint.
FAQs
The pluggable linting tool for text and markdown.
The npm package textlint receives a total of 51,580 weekly downloads. As such, textlint popularity was classified as popular.
We found that textlint demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.