-
Notifications
You must be signed in to change notification settings - Fork 18
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
Use prettier to format .md files #860
Conversation
@@ -18,6 +18,7 @@ | |||
"scripts": { | |||
"bootstrap": "lerna bootstrap", | |||
"format": "lerna run format", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect the format
script to cover the root as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default "format" implementation is prettier --write --loglevel warn \"./src/**/*.ts\"
, which does not do anything in the root dir. Thus I did not add it here.
@@ -18,6 +18,7 @@ | |||
"scripts": { | |||
"bootstrap": "lerna bootstrap", | |||
"format": "lerna run format", | |||
"format-text": "prettier --write --prose-wrap always --print-width 80 \"./*.md\" \"./docs/**/*.md\" && lerna run format-text", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This recurses, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No:
lerna run <script>
Run an npm script in each package that contains that script
i.e. lerna run format-text
runs yarn format-text
for each folder in packages/
only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right. lerna run
not yarn run
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, only thing is running it creates a change to docs/ROADMAP.md
. There are a few situations where prettier requires more than one pass to reach a stable point, which is possibly what's happened here.
In this case the change from
to
caused the second run to interprete it as a h2. Will fix manually |
First step for #829
The idea is to format code and text separatly