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

Update prettier #22520

Merged
merged 18 commits into from Apr 15, 2020
Merged

Update prettier #22520

merged 18 commits into from Apr 15, 2020

Conversation

@MichaelDeBoey
Copy link
Collaborator

@MichaelDeBoey MichaelDeBoey commented Mar 23, 2020

  • Update prettier to latest version
  • Run yarn format from root of project
  • Remove prettier-ignore for nested markdown (see #21743)

Closes #22506

@MichaelDeBoey MichaelDeBoey requested review from gatsbyjs/core as code owners Mar 23, 2020
@vladar vladar requested a review from tesseralis Apr 10, 2020
Copy link
Contributor

@vladar vladar left a comment

Thanks for the PR! I have one change request:

Prettier 2.0 had changed default value for arrowParens option from "avoid" to "always" (link). But we'd prefer to keep the old style for now.

So could you please add arrowParens: "avoid" to .prettierrc which matches previous default. This should also reduce the number of affected files in this PR.

@MichaelDeBoey MichaelDeBoey force-pushed the MichaelDeBoey:update-prettier branch 3 times, most recently from 52464d4 to a31c4d7 Apr 10, 2020
@MichaelDeBoey MichaelDeBoey requested a review from vladar Apr 10, 2020
@MichaelDeBoey MichaelDeBoey requested a review from tbntdima Apr 12, 2020
@vladar
Copy link
Contributor

@vladar vladar commented Apr 14, 2020

Sorry for the delay. I think we can merge this but need to resolve conflicts first and also figure out why the lint step fails. Mind taking a look? Then re-request a review and we'll ship it!

@MichaelDeBoey MichaelDeBoey force-pushed the MichaelDeBoey:update-prettier branch from 769b379 to 381865b Apr 14, 2020
@MichaelDeBoey
Copy link
Collaborator Author

@MichaelDeBoey MichaelDeBoey commented Apr 14, 2020

@vladar I just rebased my branch onto upstream/master

@vladar
Copy link
Contributor

@vladar vladar commented Apr 14, 2020

Yeah but for some reason lint still fails. Does it fail for you locally when running yarn lint:code ? Maybe we need to update eslint-config-prettier too.

@MichaelDeBoey
Copy link
Collaborator Author

@MichaelDeBoey MichaelDeBoey commented Apr 14, 2020

@vladar I only get warnings when running yarn lint:code when I run it locally.

Will update eslint-config-prettier too, just to be sure 🙂

@MichaelDeBoey
Copy link
Collaborator Author

@MichaelDeBoey MichaelDeBoey commented Apr 14, 2020

@vladar I've found a linting error, but CI is still failing 😕

@MichaelDeBoey MichaelDeBoey requested a review from gatsbyjs/website as a code owner Apr 14, 2020
@MichaelDeBoey
Copy link
Collaborator Author

@MichaelDeBoey MichaelDeBoey commented Apr 14, 2020

@vladar I updated all .prettierrc files and ran Prettier on the full codebase.
I hope this will fix CI

@MichaelDeBoey
Copy link
Collaborator Author

@MichaelDeBoey MichaelDeBoey commented Apr 14, 2020

@vladar Linting is passing, but still errors on unit tests.
Can't figure out what causes them to fail tho 😕

@vladar
Copy link
Contributor

@vladar vladar commented Apr 15, 2020

I think tests are failing because prettier output is captured in snapshots in several plugins. You need to run yarn run jest --updateSnapshot in the repo root to update them all.

Also, sadly, there are new conflicts. Looks like we must move fast after changes to be able to merge this 😄

@@ -173,7 +173,8 @@ To write a new GraphQL example, a Codesandbox project with a Gatsby site can be
```mdx
Here's an example of a GraphQL query inline:
<iframe src="https://711808k40x.sse.codesandbox.io/___graphql?query=query%20TitleQuery%20%7B%0A%20%20site%20%7B%0A%20%20%20%20siteMetadata%20%7B%0A%20%20%20%20%20%20title%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A&explorerIsOpen=false&operationName=TitleQuery" /> // highlight-line
<iframe src="https://711808k40x.sse.codesandbox.io/___graphql?query=query%20TitleQuery%20%7B%0A%20%20site%20%7B%0A%20%20%20%20siteMetadata%20%7B%0A%20%20%20%20%20%20title%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A&explorerIsOpen=false&operationName=TitleQuery" /> //
highlight-line

This comment has been minimized.

@vladar

vladar Apr 15, 2020
Contributor

Moving highlight-line to the new line doesn't look right.

This comment has been minimized.

@muescha

muescha Apr 15, 2020
Collaborator

this got merged with the new line

This comment has been minimized.

@vladar

vladar Apr 15, 2020
Contributor

Thanks for noticing! Created a PR to address this: #23140

@MichaelDeBoey MichaelDeBoey force-pushed the MichaelDeBoey:update-prettier branch from 1d40082 to 36baef8 Apr 15, 2020
@MichaelDeBoey
Copy link
Collaborator Author

@MichaelDeBoey MichaelDeBoey commented Apr 15, 2020

@vladar I just rebased the branch and tried to run yarn test:update in the root, but that throws a lot of errors:

 Cannot find module 'gatsby-core-utils' from 'path-serializer.ts'

Can't figure out what causes this error tho 😕

@vladar
Copy link
Contributor

@vladar vladar commented Apr 15, 2020

Maybe try running yarn bootstrap first?

@MichaelDeBoey MichaelDeBoey force-pushed the MichaelDeBoey:update-prettier branch from d8f22a7 to 71c8bbb Apr 15, 2020
package.json Outdated Show resolved Hide resolved
This reverts commit 008eb99
@MichaelDeBoey MichaelDeBoey requested a review from vladar Apr 15, 2020
MichaelDeBoey and others added 2 commits Apr 15, 2020
Co-Authored-By: Dima An <dmitriym44@gmail.com>
@vladar
vladar approved these changes Apr 15, 2020
Copy link
Contributor

@vladar vladar left a comment

Finally, it's green! Sorry for the churn but it's done now! Let's ship it while we can :) Great job! 💜

@gatsbybot gatsbybot merged commit ff911e2 into gatsbyjs:master Apr 15, 2020
22 of 24 checks passed
22 of 24 checks passed
build-test Workflow: build-test
Details
ci/circleci: starters_validate Your tests failed on CircleCI
Details
TypoCheck Found a few typos
Details
Cloud Tests
Details
Danger All good
Details
Peril All green. Yay.
Details
ci/circleci: bootstrap Your tests passed on CircleCI!
Details
ci/circleci: e2e_tests_development_runtime Your tests passed on CircleCI!
Details
ci/circleci: e2e_tests_gatsby-image Your tests passed on CircleCI!
Details
ci/circleci: e2e_tests_path-prefix Your tests passed on CircleCI!
Details
ci/circleci: e2e_tests_production_runtime Your tests passed on CircleCI!
Details
ci/circleci: integration_tests_cache_resilience Your tests passed on CircleCI!
Details
ci/circleci: integration_tests_gatsby_cli Your tests passed on CircleCI!
Details
ci/circleci: integration_tests_gatsby_pipeline Your tests passed on CircleCI!
Details
ci/circleci: integration_tests_long_term_caching Your tests passed on CircleCI!
Details
ci/circleci: integration_tests_structured_logging Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: themes_e2e_tests_development_runtime Your tests passed on CircleCI!
Details
ci/circleci: themes_e2e_tests_production_runtime Your tests passed on CircleCI!
Details
ci/circleci: unit_tests_node10 Your tests passed on CircleCI!
Details
ci/circleci: unit_tests_node12 Your tests passed on CircleCI!
Details
ci/circleci: unit_tests_www Your tests passed on CircleCI!
Details
ci/circleci: windows_unit_tests Your tests passed on CircleCI!
Details
cypress: default-group 139 tests passed in 03:00
Details
@MichaelDeBoey
Copy link
Collaborator Author

@MichaelDeBoey MichaelDeBoey commented Apr 15, 2020

I'm happy it got green 🙂

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

Successfully merging this pull request may close these issues.

5 participants
You can’t perform that action at this time.