Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add linting and code snippet validation #1983

Open
wants to merge 3 commits into
base: source
Choose a base branch
from

Conversation

sarahxsanders
Copy link

@sarahxsanders sarahxsanders commented Apr 6, 2025

Description

This PR introduces linting and code snippet validation for GraphQL snippets. JS snippets are commented out on this PR, because I will modernize the JS code snippets first.

Changes

  • Updated ESLint config to lint Markdown and MDX files in the repository + special handling for documentation snippets.
  • Created a validate-snippets.js script that extracts code snippets from MDX files and validates them against parsers. Note, I temporarily commented out JS validation logic until those code snippets are modernized to meet the latest standards.
  • Set up docs validation workflow for GHA to run on PRs. This checks for broken links and code snippets.
  • Fix: Added <!-- snippet-ignore --> for GQL snippets causing errors

Comments

Review

Copy link

vercel bot commented Apr 6, 2025

@sarahxsanders is attempting to deploy a commit to the The GraphQL Foundation Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

linux-foundation-easycla bot commented Apr 6, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@sarahxsanders sarahxsanders marked this pull request as ready for review April 6, 2025 22:48
Copy link

vercel bot commented Apr 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
graphql-github-io ❌ Failed (Inspect) Apr 8, 2025 8:15am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants