The `house-vale-3-15-2-repro` provenance entry claimed behaviours were reproduced against purpose-built fixtures, but no fixtures existed, so the earlier commit in this PR removed it. Commit the fixtures. tests/test-vale-3-15-2-behaviours.sh builds its fixtures in a temp dir and runs the real Vale. It exits 77 (skipped) when vale is missing or is not 3.15.2. It asserts the six vale-config behaviours and the vale-run ones (unmapped .mdx, `vale off` variants, the spelling ignore file, and the ls-* commands never naming a rule). Restore the entry in both sources.md files as `Research doc: none` with `Basis:` naming the test, and re-add its source_keys. Two behaviours are not asserted: the native-MDX suppression column (needs mdx2vast) and the `vale sync` row that adds to Packages (needs the network). The wording in configuration-reference.md and troubleshooting.md now says so. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EGHFJextYtVQseaHPDDhxB
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.