What is a style?
A style is a directory containing one or more rule files. Each rule file defines a single check that Vale applies to your content. For example:Extension points
Vale provides 12 extension points that define how rules match and evaluate text. Each rule file must declare which extension point it uses via theextends key.
- existence
- substitution
- occurrence
- repetition
- consistency
- conditional
- capitalization
- readability
- spelling
- sequence
- metric
- script
Checks for the presence of specific words or patterns.Use
existence when you want to flag specific terms, phrases, or patterns. The rule triggers whenever any token is found in the text.Key attributes:tokens: List of terms to search forignorecase: Whether to ignore case (default: true)nonword: Match anywhere, not just word boundariesexceptions: Terms to ignore even if they match
Rule definition structure
Every rule file follows this basic structure:Required fields
Required fields
extends: The extension point (one of the 12 types)message: The alert message shown to users
Optional fields
Optional fields
description: Extended explanation of the rulelevel: Severity level (suggestion, warning, or error)link: URL to style guide or documentationscope: Where the rule applies (see Scoping)action: Automated fix definitionlimit: Maximum number of alerts per file
Built-in styles
Vale includes a minimal built-in style called “Vale” with four rules:Vale.Avoid
Vale.Avoid
An
existence rule with an empty token list. You can customize this via your vocabulary.Vale.Terms
Vale.Terms
A
substitution rule for term consistency, integrated with vocabularies.Vale.Repetition
Vale.Repetition
A
repetition rule that catches repeated words.Vale.Spelling
Vale.Spelling
A
spelling rule that integrates with your vocabularies.Using multiple styles
You can apply multiple styles to your content by listing them in your configuration:Style loading order
Vale searches for styles in this order:- The
StylesPathdirectory specified in.vale.ini - The global styles directory (when using
vale sync) - Built-in styles
internal/check/definition.go:46-60, internal/check/definition.go:122-166