fix(lint): correct four Vale behaviours the skills described wrongly
Each of these would send a user down a path Vale does not support: Core options placed under a glob header are not scoped to that glob — Vale rejects them with E201, so the guidance to nest them produced a config that will not load. The built-in `Vale` style is compiled in, but Vale still requires StylesPath to exist on disk before it will run, so the "no StylesPath needed" shortcut fails. The MDX guidance was inverted: under `[formats] mdx = md` the mapping is what makes MDX lint at all, and it needs the mdx2vast prerequisite that was never mentioned. And a spelling rule's `ignore` paths resolve against StylesPath, not against the rule file's own directory, so the documented relative paths silently matched nothing.
This commit is contained in:
@@ -25,6 +25,10 @@ Map an unrecognized extension onto a supported one so Vale lints it with the rig
|
||||
mdx = md
|
||||
```
|
||||
|
||||
`mdx` is the case that matters, because Vale 3.15.2 has no built-in MDX support. The mapping above is not cosmetic: it is what lets `.mdx` files lint with nothing else installed. Leave it out and Vale takes the native MDX path, which shells out to an external `mdx2vast` binary — absent from `PATH`, the run dies with `E100 [lintMDX] Runtime error / mdx2vast not found`, exit 2, and every other file in the same invocation goes unlinted too. Install it with `npm install -g mdx2vast` or take the mapping.
|
||||
|
||||
The choice also decides the inline-suppression syntax, and it is inverted between the two: mapped to `md`, `.mdx` takes Markdown's `<!-- vale off -->`; native, it takes `{/* vale off */}`. `vale-run`'s `references/troubleshooting.md` carries the verified matrix.
|
||||
|
||||
## Vocabularies
|
||||
|
||||
Reference a named vocabulary (a folder of accept/reject word lists under `StylesPath`) via `Vocab`, then apply styles per glob:
|
||||
@@ -89,6 +93,8 @@ Only *package* styles need fetching. A style whose YAML rule files are already c
|
||||
| Style in `Packages` and synced, but in no glob's `BasedOnStyles` | 0 findings, exit 0 — downloads, never lints, indistinguishable from a clean run |
|
||||
| `BasedOnStyles` names an *empty* directory under `StylesPath` | 0 findings, exit 0 — loads and lints nothing; `vale sync` never produces this state |
|
||||
| Built-in `Vale`, or a style's YAML committed under `StylesPath` | lints immediately, no `Packages` entry, no sync |
|
||||
| Core option (`StylesPath`, `MinAlertLevel`, `Vocab`, `IgnoredScopes`, `SkippedScopes`) below a `[glob]` header | `E201 Invalid value` — `'X' is a core option; it should be defined above any syntax-specific options ([...])`, exit 2 |
|
||||
| `Packages` below a `[glob]` header | no error, exit unaffected — parsed as a per-glob rule toggle (`SChecks: {"*.md": {"Packages": false}}` in `ls-config`), so `vale sync` reports `Synced 0 package(s)` and downloads nothing |
|
||||
|
||||
## Frontmatter Scopes
|
||||
|
||||
|
||||
Reference in New Issue
Block a user