Page MenuHomeElementl

[docs-infra] set up mdx prettier `yarn format`
ClosedPublic

Authored by yuhan on Mar 30 2021, 4:25 AM.

Details

Summary

set up lint rules:

  1. proseWrap: "never": use prettier to ensure we don't break one paragraph into multiple lines in mdx
  1. use remark-lint for the other rules, because prettier's mdx support is relatively limited, which makes it hard for us to keep the formatted result consistent with remark-processed result - so i use remark lint to enable more sophisticated formatting - we can add more rules to the .remarkrc.js file in the future if needed.
    • require("remark-gfm"), { tablePipeAlign: true }: turned on GitHub Flavored Markdown's table pipe alignment (details) so cells can get auto aligned

note: i included the yarn format inside the yarn snapshot so we can ensure all the mdx files are formatted in the same way every time. this will be helpful for diffs like D7138

Test Plan

yarn snapshot

Diff Detail

Repository
R1 dagster
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Mar 30 2021, 4:45 AM
Harbormaster failed remote builds in B28217: Diff 34593!
Harbormaster returned this revision to the author for changes because remote builds failed.Mar 30 2021, 6:29 AM
Harbormaster failed remote builds in B28218: Diff 34594!

use both prettier and remark-lint

yuhan edited the test plan for this revision. (Show Details)
yuhan added reviewers: sashank, rexledesma.
yuhan requested review of this revision.Mar 30 2021, 7:21 AM

require("remark-gfm"), { tablePipeAlign: false }: i disabled the GitHub Flavored Markdown's table pipe alignment bc some cells could get very long which resulted in a lot of ----------- in mdx files.

Can we keep this actually? I find it easy easier to write then that's on

@sashank just to be clear that we are aware of the change, many concept pages will become like this:

image.png (1×1 px, 194 KB)

i dont feel strongly either way. im fine as long as it's consistent

turn on gfm tablePipeAlig

yuhan retitled this revision from [docs-infra] set up mdx prettier to [docs-infra] set up mdx prettier `yarn format`.Mar 30 2021, 10:14 PM
yuhan edited the summary of this revision. (Show Details)

I like that better because on wide screens it's easier to edit. Thank you!

This revision is now accepted and ready to land.Mar 31 2021, 11:09 PM