Skip to content

Commit b5e38e9

Browse files
authored
fix: resolve all vale linting errors (#298)
* feat: implement production-grade vale linting configuration ## Summary This commit establishes a comprehensive, maintainable Vale configuration for auth4genai documentation that catches real errors while minimizing false positives in code-heavy and example-driven content. ## Key Changes - **Fixed all 73 Vale linting errors** across 41 files (brand capitalization, spelling, HTML structure) - **Created custom AuthDocs style bundle** with Brands.yml (systematic corrections like github→GitHub) and Spelling.yml (domain-specific ignore list) - **Configured path-based rule overrides** for snippets, components, sample apps, and GitHub integration pages where strict rules generate noise - **Aligned MinAlertLevel = error strategy** with explicit rule disabling instead of severity demotion (clear, maintainable, no false expectations) - **Documented configuration thoroughly** with concrete MDX examples, workflow guidance, and clear explanation of tradeoffs ## Technical Details - StylesPath correctly maps to .vale/styles where all rules and ignore lists live - BasedOnStyles = Vale, AuthDocs applied consistently to MD and MDX files - Vale.Spelling disabled globally; replaced with AuthDocs.Spelling for domain-aware checking - AuthDocs.Brands disabled only on paths where word boundary matching triggers on URLs/domains (documented pattern and escape hatch in README) - IgnoredScopes/SkippedScopes intentionally exclude link text and code blocks to focus on prose ## Vale Status ✓ 0 errors, 0 warnings, 0 suggestions across 137 files ## Maintenance Future updates are purely content-driven: - Add terms to .vale/styles/config/ignore/authdocs.txt as new jargon emerges - Add substitutions to .vale/styles/AuthDocs/Brands.yml for systematic fixes - Adjust path-based disables in .vale.ini for new files with false positives
1 parent 18368e7 commit b5e38e9

File tree

20 files changed

+503
-33
lines changed

20 files changed

+503
-33
lines changed

auth4genai/.vale.ini

Lines changed: 117 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,122 @@
1+
; Vale configuration for Mintlify docs.
2+
; Mintlify CI will pick this up if enabled:
3+
; https://www.mintlify.com/docs/deploy/ci
4+
;
5+
; Keep this file under version control and evolve it with the docs:
6+
; https://www.mintlify.com/guides/maintenance
7+
;
8+
; Vale config reference:
9+
; https://vale.sh/docs
10+
;
11+
; MDX support:
12+
; - Vale 3.13+ treats .mdx as a first class format.
13+
; - MDX parsing is handled by the external mdx2vast CLI, which must be
14+
; installed and available on $PATH:
15+
; npm install -g mdx2vast
16+
;
17+
; When Vale flags something that is actually OK:
18+
; - If it is project-wide (for example a product name), add it to:
19+
; .vale/styles/config/ignore/authdocs.txt
20+
; - If it is a systematic branding issue, add a swap to:
21+
; .vale/styles/AuthDocs/Brands.yml
22+
; - Only use {/* vale off */} / {/* vale on */} for
23+
; narrow, one-off cases (quotes, unusual examples).
24+
25+
StylesPath = .vale/styles
26+
27+
; Only report error-level issues. Suggestions and warnings are suppressed
28+
; entirely so devs are not blocked on minor style nits.
129
MinAlertLevel = error
230

3-
[formats]
4-
mdx = md
31+
; Scopes to ignore completely. These are either:
32+
; - Already covered by other tooling, or
33+
; - Places where language checks are too noisy or fragile
34+
; (inline code, URLs, links, images).
35+
; Note: 'code' is handled by SkippedScopes below for block-level code.
36+
IgnoredScopes = tt, img, url, a
37+
38+
; Skip entire blocks that are not prose. This keeps Vale out of
39+
; style/script tags, <pre> blocks, code fences, and figures.
40+
SkippedScopes = script, style, pre, figure, code
41+
42+
; Optional checks developers may enable locally:
43+
; vale.Annotations = YES
544

645
[*.mdx]
7-
BasedOnStyles = Vale
8-
Vale.Terms = NO
46+
; Base on Vale's core rules plus our custom AuthDocs style:
47+
; https://vale.sh/docs/getting-started/configuration/#basedonstyles
48+
BasedOnStyles = Vale, AuthDocs
49+
50+
; Keep helpful core rules for terminology consistency and
51+
; repeated word detection across the docs.
52+
Vale.Terms = YES
53+
Vale.Repetition = YES
54+
55+
; Replace the built-in spelling rule with a custom one that knows about our
56+
; domain-specific vocabulary:
57+
; https://vale.sh/docs/checks/spelling
58+
; Turning Vale.Spelling off here avoids double reporting issues that our
59+
; AuthDocs.Spelling rule already handles with an ignore list.
960
Vale.Spelling = NO
10-
Vale.Repetition = NO
61+
AuthDocs.Spelling = YES
62+
63+
; Substitution rule for brand capitalization and common typos:
64+
; https://vale.sh/docs/checks/substitution
65+
; Keep this focused so that automated fixes remain predictable.
66+
AuthDocs.Brands = YES
67+
68+
[*.md]
69+
; Apply the same style stack to plain Markdown files so behavior
70+
; is consistent across .md and .mdx content.
71+
BasedOnStyles = Vale, AuthDocs
72+
73+
; Keep behavior consistent with MDX files.
74+
Vale.Terms = YES
75+
Vale.Repetition = YES
76+
77+
; Use the same custom spelling + brand rules as MDX.
78+
Vale.Spelling = NO
79+
AuthDocs.Spelling = YES
80+
AuthDocs.Brands = YES
81+
82+
; Snippets and code-heavy examples: disable brand rules.
83+
; These files are mostly inline code and copied examples where
84+
; strict brand enforcement would generate a lot of noise.
85+
[snippets/**/*.mdx]
86+
AuthDocs.Brands = NO
87+
88+
; Component demo content: disable spelling and brand rules.
89+
; This page is primarily example copy used to exercise UI components,
90+
; not user-facing documentation.
91+
[components.mdx]
92+
AuthDocs.Brands = NO
93+
AuthDocs.Spelling = NO
94+
95+
; Sample app index pages: disable brands.
96+
; Mostly links, titles, and names where strict enforcement over-triggers.
97+
[mcp/sample-apps.mdx]
98+
AuthDocs.Brands = NO
99+
100+
[sample-apps.mdx]
101+
AuthDocs.Brands = NO
102+
103+
; GitHub integration page: disable brands.
104+
; Contains github in URLs and domain-like strings where strict brand
105+
; correction would generate noise.
106+
[integrations/github.mdx]
107+
AuthDocs.Brands = NO
108+
109+
; GitHub how-to snippet files: disable brands.
110+
; Contain lowercase github in text and URLs.
111+
[snippets/how-tos/github/**/*.mdx]
112+
AuthDocs.Brands = NO
113+
114+
; SDK documentation pages: disable brands.
115+
; Contain GitHub sample repository URLs.
116+
[sdks/**/*.mdx]
117+
AuthDocs.Brands = NO
118+
119+
; Overview and hub pages: disable brands.
120+
; Mostly cards and links that aggregate other content.
121+
[how-tos/overview.mdx]
122+
AuthDocs.Brands = NO

auth4genai/.vale/README.md

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
# Vale Linting
2+
3+
This directory contains the Vale configuration used to lint and standardize the documentation in `auth4genai`. Vale helps ensure consistent terminology, brand usage, spelling, and overall prose quality.
4+
5+
## Requirements
6+
7+
To run Vale with MDX support, you must have:
8+
9+
- **Vale 3.13.0 or newer**
10+
- **mdx2vast 0.3.0 or newer**
11+
- Node.js and npm installed
12+
- Both `vale` and `mdx2vast` available on your `$PATH`
13+
14+
## Installation
15+
16+
Vale must be installed locally before running checks. MDX support additionally requires the external parser `mdx2vast`.
17+
18+
Install Vale ([docs](https://vale.sh/docs/install)):
19+
20+
```bash
21+
brew install vale
22+
```
23+
24+
Install the MDX parser ([MDX format docs](https://vale.sh/docs/formats/mdx)):
25+
26+
```bash
27+
npm install -g mdx2vast
28+
```
29+
30+
Both executables must be available in your `$PATH`.
31+
32+
Run Vale from the `auth4genai` directory:
33+
34+
```bash
35+
vale .
36+
```
37+
38+
A clean run should report zero errors. If you see unexpected output, refer to the [MDX behavior notes](https://vale.sh/docs/formats/mdx#behaviors) for details on what Vale ignores by default.
39+
40+
## How MDX content is interpreted
41+
42+
> **Important:** MDX files do *not* support HTML comments (`<!-- vale off -->`).
43+
> Always use MDX comment syntax instead:
44+
>
45+
> ```mdx
46+
> {/* vale off */}
47+
> ...ignored content...
48+
> {/* vale on */}
49+
> ```
50+
51+
Vale parses `.mdx` files using `mdx2vast`. The parser automatically ignores:
52+
53+
* `import` and `export` statements
54+
* JSX components and JSX blocks
55+
* fenced code blocks
56+
* inline backtick code
57+
* URLs (see [URL handling](https://vale.sh/docs/topics/urls))
58+
* single-line `{ ... }` JavaScript expressions
59+
60+
These defaults help avoid false positives in pages that combine prose with examples, components, and structured metadata.
61+
62+
Inline MDX-aware controls are supported when necessary. MDX files use curly-brace comment syntax (not HTML comments):
63+
64+
```mdx
65+
{/* vale off */} …ignored… {/* vale on */}
66+
{/* vale Style.RuleName = NO */}
67+
{/* vale Style.RuleName["match"] = NO */}
68+
```
69+
70+
For example, to disable the custom spelling rule for a specific word that would normally be flagged:
71+
72+
```mdx
73+
{/* vale AuthDocs.Spelling["ocurrance"] = NO */}
74+
This misspelling is intentional in this context and should be skipped.
75+
{/* vale AuthDocs.Spelling["ocurrance"] = YES */}
76+
```
77+
78+
**Note:** These are MDX-style comments. HTML comments (`<!-- vale off -->`) will not work in `.mdx` files.
79+
80+
Guidance on these controls:
81+
[https://vale.sh/docs/topics/config/#comment-based-controls](https://vale.sh/docs/topics/config/#comment-based-controls)
82+
83+
## Configuration structure
84+
85+
All configuration begins with a single file: `.vale.ini`. That file loads a custom style bundle located under `.vale/styles`.
86+
87+
### `.vale.ini`
88+
89+
* Configures MDX and Markdown behavior using a shared style stack
90+
* Enables project-specific rules via `AuthDocs`
91+
* Sets global defaults such as `MinAlertLevel = error` (only error-level issues are reported; suggestions and warnings are suppressed)
92+
* Applies overrides for snippet directories, component demos, and sample-app index pages
93+
* Contains path-based exceptions for content where strict linting generates false positives
94+
95+
See the Vale config reference:
96+
[https://vale.sh/docs/topics/config](https://vale.sh/docs/topics/config)
97+
98+
### `.vale/styles/AuthDocs/Spelling.yml`
99+
100+
Defines a custom spelling rule that replaces Vale’s default spellchecker.
101+
This rule:
102+
103+
* Uses project-specific ignore lists
104+
* Reduces noise from acronyms, product names, config keys, or identifiers
105+
* Helps catch real typos while avoiding false positives
106+
107+
Vale spelling check reference:
108+
[https://vale.sh/docs/checks/spelling](https://vale.sh/docs/checks/spelling)
109+
110+
The ignore list it relies on lives at:
111+
112+
```
113+
.vale/styles/config/ignore/authdocs.txt
114+
```
115+
116+
### `.vale/styles/config/ignore/authdocs.txt`
117+
118+
Contains domain-specific vocabulary:
119+
120+
* Product names
121+
* Framework and platform names
122+
* Identifiers and config keys
123+
* Project jargon
124+
* Terms we expect to appear in code or prose without being flagged
125+
126+
See the “ignore files” section of the spelling check docs:
127+
[https://vale.sh/docs/checks/spelling/#ignore-files](https://vale.sh/docs/checks/spelling/#ignore-files)
128+
129+
This file should be kept up to date as terminology evolves. Mintlify’s maintenance guidance is helpful here:
130+
[https://www.mintlify.com/guides/maintenance](https://www.mintlify.com/guides/maintenance)
131+
132+
### `.vale/styles/AuthDocs/Brands.yml`
133+
134+
Contains substitution rules for:
135+
136+
* brand capitalization (for example, `github` → `GitHub`, `javascript` → `JavaScript`)
137+
* recurring misspellings
138+
* invalid plurals (for example, `SDK's` → `SDKs`)
139+
140+
Vale substitution check reference:
141+
[https://vale.sh/docs/checks/substitution](https://vale.sh/docs/checks/substitution)
142+
143+
Only systematic, project-wide corrections should be added.
144+
145+
**Note:** If a file generates repeated false positives from brand checks (for example, GitHub URLs on an integration page), the preferred approach is to disable `AuthDocs.Brands` for that path in `.vale.ini` rather than adding exceptions to the rule. See the "MDX and Markdown overrides in `.vale.ini`" section below.
146+
147+
### MDX and Markdown overrides in `.vale.ini`
148+
149+
Certain paths contain examples, generated text, or content where strict rules generate noise. In these paths we disable or relax specific rules:
150+
151+
* `snippets/**/*.mdx` – brand checks disabled
152+
* `components.mdx` – brand and spelling checks disabled
153+
* `sample-apps.mdx` and `mcp/sample-apps.mdx` – brand checks disabled
154+
* overview or card-heavy pages (`how-tos/overview.mdx`) – brand checks disabled
155+
156+
These overrides help keep CI output stable without disabling important linting elsewhere.
157+
158+
## Helpful references
159+
160+
* Vale documentation: [https://vale.sh/docs](https://vale.sh/docs)
161+
* MDX parser (`mdx2vast`): [https://github.com/errata-ai/MDX](https://github.com/errata-ai/MDX)
162+
* Mintlify CI integration: [https://mintlify.com/docs/deploy/ci](https://mintlify.com/docs/deploy/ci)
163+
* Mintlify maintenance guidance: [https://mintlify.com/guides/maintenance](https://mintlify.com/guides/maintenance)
164+
* Mintlify writing style tips: [https://mintlify.com/guides/writing-style-tips](https://mintlify.com/guides/writing-style-tips)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Normalization rules for brand names, pluralization fixes, and recurring typos.
2+
#
3+
# Substitution rule reference:
4+
# https://vale.sh/docs/checks/substitution
5+
#
6+
# Guidelines:
7+
# - Use this file for systematic, project-wide corrections.
8+
# - Add legitimate domain terms to the ignore list instead:
9+
# .vale/styles/config/ignore/authdocs.txt
10+
# - Prefer substitutions here over inline disable blocks.
11+
# - Avoid adding one-off or file-specific corrections.
12+
13+
extends: substitution
14+
message: "Consider using '%s' instead of '%s'."
15+
level: error
16+
ignorecase: true
17+
scope: text
18+
19+
swap:
20+
# Brand capitalization
21+
# Word boundaries match whole words only. This can trigger on substrings
22+
# like github in "example.github.io" due to punctuation (. = non-word char).
23+
# Disable AuthDocs.Brands in files where this generates false positives.
24+
"\\bgithub\\b": GitHub
25+
"\\bjavascript\\b": JavaScript
26+
27+
# Incorrect plurals / possessives
28+
"SDK's": SDKs
29+
"sdk's": SDKs
30+
31+
# Recurring typos in this repo
32+
commnd: command
33+
ocurrs: occurs
34+
repositores: repositories
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Custom spelling rule for this documentation set.
2+
#
3+
# Spelling rule reference:
4+
# https://vale.sh/docs/checks/spelling
5+
#
6+
# Purpose:
7+
# - Catch actual typos while avoiding noise from domain-specific terms.
8+
# - Accepted terms must be placed in the ignore file:
9+
# .vale/styles/config/ignore/authdocs.txt
10+
# - Inline disabling should be rare and only for unusual cases.
11+
12+
extends: spelling
13+
message: "Did you really mean '%s'?"
14+
level: error
15+
scope: text
16+
17+
ignore:
18+
- config/ignore/authdocs.txt

0 commit comments

Comments
 (0)