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

Lint / prettify MDX (including code blocks) #6914

Draft
wants to merge 6 commits into
base: version-4
Choose a base branch
from

Conversation

trevor-scheer
Copy link
Member

Paired with @trevorblades to update our eslint and prettier config to prettify code blocks.

Aside from noise, I think this change is fairly uncontroversial and @rkoron007 has expressed that she would find the DX offered here to be a major improvement on what she currently does for code block formatting.

TODO:

  • Enforce at CI

@netlify
Copy link

netlify bot commented Sep 16, 2022

Deploy Preview for apollo-server-docs ready!

Name Link
🔨 Latest commit 562e82e
🔍 Latest deploy log https://app.netlify.com/sites/apollo-server-docs/deploys/6324e41955cf4700088672f4
😎 Deploy Preview https://deploy-preview-6914--apollo-server-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 16, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 562e82e:

Sandbox Source
Apollo Server Typescript Configuration
Apollo Server Configuration

@trevor-scheer
Copy link
Member Author

Comments are unfortunately the only thing blocking this PR. The parser breaks on HTML-style comments. JSX-style comments are acceptable by the parser, but turn up in the final HTML.

So, we either:

  1. Figure a way to strip HTML comments before mdx parsing happens
  2. Print JSX-style comments correctly (i.e. don't print them) when we generate the HTML

cc @trevorblades, any insight?

@glasser
Copy link
Member

glasser commented Dec 6, 2022

Removing myself from this old draft PR to stop the daily pings (I do think this is a good idea though if @trevorblades can help us with the comments).

@trevor-scheer
Copy link
Member Author

Yeah, I think this one is worth leaving open, it's just blocked by apollographql/docs#249 which DX has said they intend to do eventually. A lot of the conflicts should resolve trivially since the file updates are all done by tooling.

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.

None yet

2 participants