← 返回命令列表

Linux command

vale 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Lint files

vale [path/to/files]

Lint markdown files

vale [docs/**/*.md]

Use a specific configuration file

vale --config [.vale.ini] [file.md]

Show only errors

vale --minAlertLevel error [file.md]

Output in JSON format

vale --output JSON [file.md]

Lint content from stdin

echo "[text]" | vale --ext .md

List configured directories

vale ls-dirs

Sync styles

vale sync

说明

Vale is a syntax-aware prose linter that brings code-like linting to documentation and prose. It checks writing against customizable style rules for consistency, grammar, and corporate style guides. Vale supports Markdown, AsciiDoc, reStructuredText, HTML, and other markup formats. It can use community style packages (Microsoft, Google, write-good) or custom rules defined in YAML. Configuration is managed through .vale.ini files that specify which styles to use, file patterns to check, and vocabulary exceptions.

参数

--config _file_
Use specified configuration file (.vale.ini).
--ext _extension_
Assign a file extension to stdin input (e.g., `.md`, `.rst`).
--glob _pattern_
Only lint files matching the glob pattern.
--filter _expr_
Filter rules by a CEL-style expression (e.g. `".Level == 'error'"`).
--minAlertLevel _level_
Minimum alert level: `suggestion`, `warning`, or `error`.
--output _format_
Output format: `CLI` (default), `JSON`, `line`, or path to a template file.
--no-exit
Always exit with status 0 regardless of errors.
--no-wrap
Do not wrap output lines.
--no-global
Skip loading the global configuration.
--relative
Report paths relative to the current directory.
--sort
Sort output by file path and line number.
--ignore-syntax
Treat all input as plain text (skip syntax-aware parsing).
-v, --version
Display version information.
-h, --help
Display help message.

FAQ

What is the vale command used for?

Vale is a syntax-aware prose linter that brings code-like linting to documentation and prose. It checks writing against customizable style rules for consistency, grammar, and corporate style guides. Vale supports Markdown, AsciiDoc, reStructuredText, HTML, and other markup formats. It can use community style packages (Microsoft, Google, write-good) or custom rules defined in YAML. Configuration is managed through .vale.ini files that specify which styles to use, file patterns to check, and vocabulary exceptions.

How do I run a basic vale example?

Run `vale [path/to/files]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --config _file_ do in vale?

Use specified configuration file (.vale.ini).