vale-config deleted "settings in a glob section only apply to files matching that glob" — the single most common Vale misconfiguration. Nothing in either lint skill told an agent that BasedOnStyles under `[*.md]` governs `.md` only; the nearest survivor was a parenthetical in a reference file the skill opens only for the full field listing. Restored to the always-loaded body, at the point of use. vale-config also never mentioned `[formats]` or MDX at all, leaving the whole decision in that same reference file. Verified against Vale 3.15.2: an unmapped `.mdx` covered by one of your globs is `E100 [lintMDX]`, exit 2, and every other file in that invocation produces no output whatsoever. Because the failure is invocation-wide rather than per-file, it belongs in the Gotchas. The crash requires a glob that actually covers `.mdx` — under `[*.md]` the file is skipped and nothing fails — so the Gotcha states that condition rather than the broader claim that any `.mdx` in the tree kills the run. The mapping-versus-mdx2vast attribution disagreed across the two skills: vale-run said `[formats] mdx = md` is "what vale-config recommends" while vale-config presented it as a bare either/or. Fixed on the source side by having vale-config actually recommend it and say why, which makes vale-run's existing sentence true with no edit to vale-run. Refs: #117
5.0 KiB
name, description, metadata
| name | description | metadata | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| vale-config | Use when installing or configuring Vale, the prose/style linter — writing a `.vale.ini` whose styles are fetched and actually activated — even when the user says only "set up prose linting". Not running Vale on an existing config -> `vale-run`. |
|
Gotchas
- A style in
BasedOnStylesthat is neither built-in nor a directory underStylesPathfails hard, not silently:E100 [loadStyles], exit 2, nothing linted. vale syncalone does not clear thatE100. Sync fetches only what the top-levelPackageskey declares, so against aBasedOnStyles-only name it reportsSynced 0 package(s)and exits 0, fetching nothing. Add the style toPackages, then sync. A style lints only once it is in both keys — and the reverse case is silent, exiting 0.- Only package styles need fetching: built-in
Vale, and any style whose YAML is already committed underStylesPath, lint with noPackagesentry and no sync. .vale.iniorder is enforced, not stylistic: put core settings first, then[formats], then glob sections. A core setting (StylesPath,MinAlertLevel,Vocab,IgnoredScopes,SkippedScopes) written below a[glob]header is a hard error —E201 ... 'StylesPath' is a core option; it should be defined above any syntax-specific options, exit 2, nothing linted.Packagesis the exception, and the worse one: below a glob header it is accepted with no error, then ignored —vale syncreportsSynced 0 package(s)and downloads nothing.- An
.mdxfile covered by one of your globs takes the whole run down unless[formats]maps it. Vale 3.15.2 has no built-in MDX support: unmapped, it shells out to an externalmdx2vastbinary, and with that absent fromPATHthe invocation dies onE100 [lintMDX] Runtime error / mdx2vast not found, exit 2 — every other file in the same command goes unlinted, with no output of its own. Default to the mapping — a[formats]section holdingmdx = md, above the glob sections — which needs nothing installed;npm install -g mdx2vastis the alternative. The choice also inverts the inline-suppression syntaxvale-runuses, so record which one the config took. - A rule scoped to
text.frontmatter.<key>silently matches nothing when the field spans multiple lines in most YAML forms. If you scope a rule to frontmatter, readreferences/configuration-reference.mdfirst.
Setup workflow
-
Install the
valebinary:brew install vale(macOS),snap install vale(Linux),choco install vale(Windows), ordocker pull jdkato/vale. -
Pick a
StylesPath(conventionallystyles) and create it. This is where all styles, dictionaries, and vocab live. -
Write
.vale.iniat the project root with at minimum:StylesPath = styles MinAlertLevel = suggestion [*.md] BasedOnStyles = ValeValehere is the built-in style (Vale.Spelling,Vale.Terms,Vale.Avoid,Vale.Repetition): noPackagesentry and novale sync. It still needs theStylesPathdirectory to exist — declareStylesPath = styleswithout creatingstyles/and even aVale-only config dies withE201 ... The path '...' does not exist, exit 2. That is why the previous step creates the directory.Settings in a glob section only apply to files matching that glob.
BasedOnStylesunder[*.md]governs.mdand nothing else: a.mdx,.rstor.txtin the same tree has no style active, is skipped without being counted, and a run over only such files reports0 filesand exits 0 — indistinguishable from clean. Give every extension you mean to lint a glob that covers it. -
Add third-party styles (optional) by declaring them in
Packages, then activating them in the same or another glob'sBasedOnStyles:Packages = Google, write-good [*.md] BasedOnStyles = Vale, Google, write-good -
Sync: run
vale syncto download everything listed inPackagesintoStylesPath. -
Verify activation: confirm every style named in
Packagesalso appears in at least one glob'sBasedOnStyles— an unreferenced package downloads but never lints anything.
For the full .vale.ini field reference (formats mapping, vocab, local overrides, custom rule header fields) and the verified style-resolution matrix — which error each misconfiguration raises, and the two that exit 0 while linting nothing — read references/configuration-reference.md.
Custom styles
A custom style is just a new subdirectory under StylesPath, holding one YAML file per rule:
styles/
└── MyStyle/
└── NoJargon.yml
Each rule file needs extends (the check it implements, e.g. existence) and message at minimum. Activate the style the same way as any other: add MyStyle to BasedOnStyles for the relevant glob. If a rule needs a field beyond those two, read references/configuration-reference.md for the full rule header field table.