For the complete documentation index, see llms.txt. This page is also available as Markdown.

BasedOnStyles

Learn how to enable a style for a specific file type.

StylesPath = styles

[*.md]
BasedOnStyles = Vale, MyStyle

BasedOnStyles enables every rule in the named styles for the files a section matches.

It's a section-level setting, so it has to appear under a glob. Putting it above the first section is an error:

'BasedOnStyles' is a syntax-specific option

To apply styles to everything, use the catch-all section:

[*]
BasedOnStyles = Vale

More than one section

When several sections match a file, the most specific one's BasedOnStyles replaces the others—it doesn't add to them:

[*]
BasedOnStyles = Vale

[*.md]
# Markdown files get Microsoft *instead of* Vale, not as well as.
BasedOnStyles = Microsoft

If you want the defaults plus something extra, name them all:

Individual rules

Rules can be switched on or off by name, and unlike BasedOnStyles, these settings accumulate across every section that matches:

That's the way to extend your defaults for one file type without repeating them.

Turning a rule off works the same way:

A rule can also be enabled on its own, without its style being listed at all:

Severity

The same syntax sets a rule's level, which overrides whatever the rule file declares:

Setting a level for a whole style requires Vale v3.17.0 or later.

A bare style name sets the default for every rule in that style, and a rule naming itself still wins:

This is the concise way to keep one part of a style while turning the rest down—or off:

See MinAlertLevel for how levels affect Vale's exit code.

Related: MinAlertLevel SkippedScopes

Last updated