LinuxCommandLibrary

textlint

TLDR

Lint markdown files

$ textlint "[docs/**/*.md]"
copy
Lint a directory
$ textlint [docs/]
copy
Auto-fix problems
$ textlint --fix [README.md]
copy
Dry run to preview fixes
$ textlint --fix --dry-run --format diff [README.md]
copy
Use specific config file
$ textlint -c [.textlintrc.json] [file.md]
copy
Lint stdin
$ cat [README.md] | textlint --stdin --stdin-filename "README.md"
copy
Output in JSON format
$ textlint --format json [docs/]
copy
Initialize configuration
$ textlint --init
copy

SYNOPSIS

textlint [options] [file|dir|glob...]

DESCRIPTION

textlint is a pluggable linter for natural language text. It checks prose for style issues, grammar problems, and writing inconsistencies using configurable rules.
Rules are installed as npm packages and configured in .textlintrc. Available rules cover spelling, terminology, sentence length, redundant phrases, and writing style guidelines. Presets bundle commonly used rule sets.
The tool supports Markdown, plain text, and other formats through plugins. It integrates with editors and CI/CD pipelines for automated text quality checks.
Auto-fix mode can automatically correct many issues. Use dry-run with diff format to preview changes before applying.
Install via npm: `npm install textlint`

PARAMETERS

-c, --config file

Configuration file path.
--ignore-path file
File with patterns to ignore (default: .textlintignore).
--init
Create configuration file if not exists.
--fix
Automatically fix problems.
--dry-run
Preview fixes without writing.
--debug
Output debugging information.
--print-config
Print resolved configuration.
--stdin
Lint text from stdin.
--stdin-filename name
Filename for stdin input.
-f, --format format
Output format: stylish, json, checkstyle, compact, junit, tap, unix.
-o, --output-file file
Write report to file.
--no-color
Disable colored output.
--quiet
Report errors only.
--no-textlintrc
Disable .textlintrc loading.
--rule rule
Rule package to use.
--preset preset
Preset package to load.
--plugin plugin
Plugin package to use.
--cache
Only check changed files.
-v, --version
Display version.
-h, --help
Display help.

CAVEATS

Requires Node.js and npm. Rules must be installed separately. Configuration complexity increases with multiple rules. Some rules may conflict with each other.

HISTORY

textlint was created by azu as an ESLint-inspired linter for prose. It applies the pluggable architecture pattern to natural language checking, allowing the community to develop specialized rules for different writing styles and languages.

SEE ALSO

Copied to clipboard