You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Code spans and fenced blocks in plain comments are linted as prose #1208
In a comment read as plain lines, a word is only treated as code when it touches a backtick. A word in the middle of a code span is linted as prose, and so is everything in a fenced example. With an existence rule on ZEBRA and this test.ts:
/** * Reads it. * * ```ts * const ZEBRA = read(); * ``` */exportfunctionf(){}// A host (`fr_FR` → `jeu. 30 ZEBRA …`) fails, and ZEBRA is prose.f();
vale test.ts reports 5:10 (inside the fence) and 10:31 (inside the span) as well as 10:52; only 10:52 is prose.
I have a fix with tests at v3...chad-loder:vale:fix/comment-code-masks. It masks these the way the doc-comment conventions already mask tags, so it depends on the fix for #1207. I'm holding both PRs while #1204 is open, per CONTRIBUTING: "Finish one before opening the next."
A comment with no format assigned is linted as plain lines, and in plain text a backtick is a character. Code spans and fences are Markdown; assign it and they're handled:
Thank you, that works. With ts = md the repro reports only 10:52, so my fix branch isn't needed.
For anyone who finds this later: the comment is then read as Markdown throughout, so a line indented four or more spaces after a blank line is an indented code block and is skipped, just as it would be in a .md file. Most doc comments are already written that way, so it rarely comes up.
Activity
jdkato commentedon Oct 16, 2026
A comment with no format assigned is linted as plain lines, and in plain text a backtick is a character. Code spans and fences are Markdown; assign it and they're handled:
chad-loder commentedon Oct 16, 2026
Thank you, that works. With
ts = mdthe repro reports only10:52, so my fix branch isn't needed.For anyone who finds this later: the comment is then read as Markdown throughout, so a line indented four or more spaces after a blank line is an indented code block and is skipped, just as it would be in a
.mdfile. Most doc comments are already written that way, so it rarely comes up.