Skip to content

Commit 638d371

Browse files
btiernayclaude
andcommitted
refactor: use path-based vale rules instead of inline comments
- Update .vale.ini with improved MDX parsing and path-based rules - Add scopes (IgnoredScopes/SkippedScopes) to skip code blocks and links - Configure TokenIgnores/BlockIgnores for import/export and JS expressions - Add path-specific rules for snippets, sample-apps, and components - Remove all 53 inline HTML vale comment lines across 27 files - Fix BlockIgnores regex to be non-greedy: (?sm)^{.+?}$ - Update snippet glob to snippets/**/*.mdx for better nested directory handling - Add scope: text to AuthDocs.Spelling rule for consistency - Restore HTML list structure in github.mdx (broken by comment removal) - Remove orphaned Info component in google-calendar/langgraph.mdx Benefits: - Cleaner, more maintainable documentation - Less noisy diffs going forward - Vale rules configured by content type, not per-block - Still passes with 0 errors, 0 warnings, 0 suggestions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent d39a8b4 commit 638d371

29 files changed

+36
-62
lines changed

auth4genai/.vale.ini

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ StylesPath = .vale/styles
1313
; Only show / fail on error-level issues in CI.
1414
MinAlertLevel = error
1515

16+
; Scopes to ignore completely
17+
IgnoredScopes = code, tt, img, url, a
18+
SkippedScopes = script, style, pre, figure, code
19+
1620
[formats]
1721
; Normalize MDX into Markdown so Vale can parse it.
1822
mdx = md
@@ -22,6 +26,9 @@ mdx = md
2226
; https://vale.sh/docs/getting-started/configuration/#basedonstyles
2327
BasedOnStyles = Vale, AuthDocs
2428

29+
; MDX-aware comment delimiters for inline vale off/on
30+
CommentDelimiters = {/*, */}
31+
2532
; Keep helpful core rules.
2633
Vale.Terms = YES
2734
Vale.Repetition = YES
@@ -35,3 +42,25 @@ AuthDocs.Spelling = YES
3542
; Substitution rule for brand capitalization and common typos:
3643
; https://vale.sh/docs/checks/substitution
3744
AuthDocs.Brands = YES
45+
46+
; MDX structural patterns to ignore:
47+
; - import/export statements
48+
; - JavaScript expression blocks (non-greedy to avoid hiding content)
49+
TokenIgnores = (?m)^(?:import|export) .+$
50+
BlockIgnores = (?sm)^{.+?}$
51+
52+
; Snippets and code-heavy examples: relax brand rules
53+
[snippets/**/*.mdx]
54+
AuthDocs.Brands = suggestion
55+
56+
; Component demo content: disable strict rules
57+
[components.mdx]
58+
AuthDocs.Brands = NO
59+
AuthDocs.Spelling = suggestion
60+
61+
; Sample app index pages: mostly links and metadata
62+
[mcp/sample-apps.mdx]
63+
AuthDocs.Brands = NO
64+
65+
[sample-apps.mdx]
66+
AuthDocs.Brands = NO

auth4genai/.vale/styles/AuthDocs/Spelling.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
extends: spelling
1010
message: "Did you really mean '%s'?"
1111
level: error
12+
scope: text
1213

1314
# Paths are relative to StylesPath (here: .vale/styles).
1415
# This file lives at:

auth4genai/how-tos/list-github-repositories.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ description: "Use OpenAI, NextJS, and the Auth0-AI SDKs to list your GitHub repo
44
mode: "wide"
55
---
66

7-
<!-- vale off -->
87
import AISDKSample from "/snippets/how-tos/github/ai-sdk.mdx";
98
import CloudflareAgents from "/snippets/how-tos/github/cloudflare-agents.mdx";
109
import LangGraphJSSample from "/snippets/how-tos/github/langgraph.mdx";
@@ -13,7 +12,6 @@ import LlamaIndexSample from "/snippets/how-tos/github/llamaindex-python.mdx";
1312
import NextJSAuth0Sample from "/snippets/how-tos/github/nextjs-auth0.mdx";
1413
import GenKitSample from "/snippets/how-tos/github/genkit.mdx";
1514
import LlamaIndexJSSample from "/snippets/how-tos/github/llamaindex.mdx";
16-
<!-- vale on -->
1715
import AccountLinking from "/snippets/how-tos/account-linking.mdx";
1816
import CreateCustomApiClient from "/snippets/common/create-custom-api-client.mdx";
1917

auth4genai/integrations/github.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ GitHub apps [use fine grained permissions](https://docs.github.com/en/enterprise
2424
<Steps>
2525
<Step title="Set up app in GitHub">
2626
<ol>
27-
<!-- vale off --> <li>
27+
<li>
2828
Sign up for a [GitHub Developer account](https://github.com/signup)
29-
</li> <!-- vale on -->
30-
<!-- vale off --> <li>
29+
</li>
30+
<li>
3131
Set up a new GitHub app via [GitHub Developer Settings > GitHub
3232
Apps](https://github.com/settings/apps/new)
33-
</li> <!-- vale on -->
33+
</li>
3434
<li>
3535
Use the following settings when configuring your GitHub app:
3636
<ul>

auth4genai/mcp/sample-apps.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,12 @@ description: Explore sample MCP apps built using Auth for MCP.
55
mode: "wide"
66
---
77

8-
<!-- vale off -->
98
<Note>
109
We value your feedback! To ask questions, report issues, or request new
1110
frameworks and providers, connect with us on
1211
[GitHub](https://github.com/auth0/auth-for-genai).
1312
</Note>
14-
<!-- vale on -->
1513

16-
<!-- vale off -->
1714
<Columns cols={2}>
1815
<Card
1916
title="Task Vantage"
@@ -43,4 +40,3 @@ mode: "wide"
4340
Go further and explore our repository of standalone sample applications that showcase Auth0's authentication and authorization capabilities in MCP servers. Each sample demonstrates how to implement Auth for MCP in your MCP servers with different frameworks and different features that Auth0 offers.
4441
</Card>
4542
</Columns>
46-
<!-- vale on -->

auth4genai/sample-apps.mdx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,12 @@ sidebarTitle: AI Agent Sample Apps
55
mode: "wide"
66
---
77

8-
<!-- vale off -->
98
<Note>
109
We value your feedback! To ask questions, report issues, or request new
1110
frameworks and providers, connect with us on
1211
[GitHub](https://github.com/auth0/auth-for-genai).
1312
</Note>
14-
<!-- vale on -->
1513

16-
<!-- vale off -->
1714
<Columns cols={2}>
1815
<Card
1916
title="Assistant0"
@@ -41,7 +38,6 @@ mode: "wide"
4138
[LlamaIndex + Next.js
4239
version](https://github.com/auth0-samples/auth0-assistant0/tree/main/ts-llamaindex)
4340
</li>
44-
<!-- vale on -->
4541
</ul>
4642
</Card>
4743
<Card
@@ -80,4 +76,3 @@ mode: "wide"
8076
demonstrate recommended implementation patterns for the SDKs.
8177
</Card>
8278
</Columns>
83-
<!-- vale on -->

auth4genai/sdks/javascript-sdk.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ Checkout our sample applications for JavaScript/TypeScript built with frameworks
9292
(Gmail, Google Calendar, etc) securely using Token Vault, Human-in-the-loop
9393
interactions using Asynchronous Authorization, and using Auth0 FGA for
9494
securing RAG tools.
95-
<!-- vale off -->
9695
<ul className="list-disc list-inside pl-4">
9796
<li>
9897
[LangGraph
@@ -106,7 +105,6 @@ Checkout our sample applications for JavaScript/TypeScript built with frameworks
106105
[LlamaIndex
107106
version](https://github.com/auth0-samples/auth0-assistant0/tree/main/ts-llamaindex)
108107
</li>
109-
<!-- vale on -->
110108
</ul>
111109
</Card>
112110
<Card

auth4genai/snippets/get-started/langchain-next-js/async-auth.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,9 @@ export const { GET, POST, PUT, PATCH, DELETE, OPTIONS, runtime } =
152152
```
153153
154154
### Add Custom Authentication
155-
<!-- vale off -->
156155
<Info>
157156
For more information on how to add custom authentication for your LangGraph Platform application, read the [Custom Auth](https://langchain-ai.github.io/langgraphjs/how-tos/auth/custom_auth/) guide.
158157
</Info>
159-
<!-- vale on -->
160158
In your `langgraph.json`, add the path to your auth file:
161159
```typescript langgraph.json wrap lines highlight={8}
162160
{

auth4genai/snippets/get-started/langchain-next-js/auth-for-rag.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,9 @@ export const getUser = async () => {
180180
```
181181

182182
### Add Custom Authentication
183-
<!-- vale off -->
184183
<Info>
185184
For more information on how to add custom authentication for your LangGraph Platform application, read the [Custom Auth](https://langchain-ai.github.io/langgraphjs/how-tos/auth/custom_auth/) guide.
186185
</Info>
187-
<!-- vale on -->
188186
In your `langgraph.json`, add the path to your auth file:
189187
```typescript langgraph.json wrap lines highlight={8}
190188
{

auth4genai/snippets/get-started/langchain-next-js/call-others-api.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,9 @@ export const { GET, POST, PUT, PATCH, DELETE, OPTIONS, runtime } =
216216
```
217217
218218
### Add Custom Authentication
219-
<!-- vale off -->
220219
<Info>
221220
For more information on how to add custom authentication for your LangGraph Platform application, read the [Custom Auth](https://langchain-ai.github.io/langgraphjs/how-tos/auth/custom_auth/) guide.
222221
</Info>
223-
<!-- vale on -->
224222
In your `langgraph.json`, add the path to your auth file:
225223
```typescript langgraph.json wrap lines highlight={8}
226224
{

0 commit comments

Comments
 (0)