Supported Formats
Vale automatically detects and processes these formats based on file extensions:Markup Formats
- Markdown:
.md,.mdown,.markdown,.markdn - MDX:
.mdx(Markdown with JSX) - reStructuredText:
.rst,.rest - AsciiDoc:
.adoc,.asciidoc,.asc - HTML:
.html,.htm,.shtml,.xhtml - XML:
.xml,.xsd - DITA:
.dita - Org:
.org
Code Formats
Vale can process comments in code files:- C/C++:
.c,.cpp,.cc,.h,.hpp,.c++,.h++ - C#:
.cs,.csx - Go:
.go - Java:
.java,.bsh - JavaScript:
.js,.jsx - TypeScript:
.ts,.tsx - Python:
.py,.py3w,.pyw,.pyi - Ruby:
.rb,Gemfile,Rakefile,Brewfile,.gemspec - Rust:
.rs - PHP:
.php - Lua:
.lua - Haskell:
.hs - Clojure:
.clj,.cljs,.cljc,.cljd - R:
.r,.R - Perl:
.pl,.pm,.pod - PowerShell:
.ps1,.psm1,.psd1 - Scala:
.scala,.sbt - Swift:
.swift - CSS:
.css,.sass,.less - Protocol Buffers:
.proto
Data Formats
- JSON:
.json - YAML:
.yaml,.yml - TOML:
.toml
Plain Text
- Text:
.txt
Format Mapping
The[formats] section maps unknown file extensions to known formats:
- Process
.tsfiles like.jsfiles - Process
.mdxfiles like.mdfiles - Process
.jsxfiles like.jsfiles - Process
.vuefiles like.htmlfiles
Maps file extensions to Vale’s internal format handlers. The key is the extension to map (without a dot), and the value is the target format.
Format-Specific Configuration
Use syntax-specific sections to configure how Vale processes different formats.Markup Transformations
For XML formats, you can apply XSLT transformations before processing:Path to an XSLT stylesheet (relative to the config file). The stylesheet should transform XML to HTML.
Token Ignoring
Ignore inline patterns specific to a format:Regular expressions for inline tokens to ignore. Comma-separated list.
Block Ignoring
Ignore entire blocks of text:Regular expressions for blocks to ignore. Use
(?s) for multiline patterns.Comment Processing
For code files, specify custom comment delimiters:Start and end delimiters for block comments. Must be exactly two values in curly braces.
Vale v3+ uses tree-sitter grammars for most languages, so
CommentDelimiters is only needed for languages without tree-sitter support.Scope Control
Control which parts of markup files Vale processes.Ignored Scopes
Completely ignore specific HTML elements:HTML tags and scopes to completely ignore. Applies globally or per syntax.
Skipped Scopes
Skip block-level elements:IgnoredScopes but for block elements.
Block-level HTML elements to skip.
Ignored Classes
Ignore elements with specific CSS classes:CSS class names. Elements with these classes are ignored.
Complex Scope Patterns
For markup formats that support custom scopes:title field in MDX frontmatter in addition to code blocks.
Language Identification
Specify language IDs for syntax highlighting and tree-sitter grammar selection:Language identifier for tree-sitter grammar selection. Affects how code and embedded content are parsed.
AsciiDoc Configuration
AsciiDoc supports custom attributes via the[asciidoctor] section:
AsciiDoc attributes as key-value pairs.
Data Format Views
For structured data formats (JSON, YAML), use views to extract specific content:config/views/[name].yml and specify which fields to extract and lint.
Name of a view definition from
config/views/. The view extracts specific content from structured files.Example: Multi-Format Project
Here’s a comprehensive example for a project with multiple format types:Format Detection
Vale determines a file’s format using this process:- Check format mapping: Look in
[formats]section - Match extension: Use built-in extension patterns
- Detect format type: Classify as markup, code, data, or text
- Apply settings: Use format-specific configuration
Embedded Formats
Some formats support embedded content:Markdown with Embedded Code
Vale automatically extracts code comments from fenced code blocks:Data Formats with Embedded Text
Use views to extract text from structured data:Troubleshooting
Format Not Recognized
If Vale doesn’t recognize a format:- Add a format mapping in
[formats] - Create a syntax-specific section
- Verify the file extension matches
Incorrect Parsing
If a format is parsed incorrectly:- Check for conflicting scope settings
- Verify
TokenIgnorespatterns - Use
--debugto see parsing details
Performance Issues
For large or complex files:- Use
IgnoredScopesto skip large sections - Add specific
TokenIgnorespatterns - Create a custom view for data formats
- Consider splitting large files