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

adds a prettier ignore file #9809

Merged
merged 5 commits into from
Jun 24, 2022
Merged

adds a prettier ignore file #9809

merged 5 commits into from
Jun 24, 2022

Conversation

jpvajda
Copy link
Contributor

@jpvajda jpvajda commented Jun 10, 2022

This PR adds a .prettierignore file in order to prevent prettier from over writing some formatting choices we've made for our docs.

Relates to

#9777

References

https://prettier.io/docs/en/ignore.html#ignoring-files

@jpvajda
Copy link
Contributor Author

jpvajda commented Jun 10, 2022

One thing to note on this before merging ,locally I still saw prettier overwriting the error-handling.mdx file as I was testing the use of * instead of - for markdown bullets, as prettier prefers - and we prefer *. So I was curious if we needed to actually merge this file into the repo before it would actually take effect. I spent about an hour troubleshooting it, and coudln't determine why even with this file, Prettier still made the auto-correction to the file.

A way to test this PR would be to:

  1. install the prettier vsCode plugin
  2. pull the code down and attempt make a change to the file error-handling.mdx
  3. if the ignore file is working, Prettier should completely ignore this file
  4. if the ignore file isn't working, Prettier will change all bullets from * to -

Copy link
Contributor

@StephenBarlow StephenBarlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me if it does what it says on the tin!

@jpvajda
Copy link
Contributor Author

jpvajda commented Jun 14, 2022

Before I merge, I just wanted to get @benjamn approval on this thanks @StephenBarlow !

@jpvajda
Copy link
Contributor Author

jpvajda commented Jun 23, 2022

@alessbell 👋 This is a pretty straight forward PR for using a prettier ignore file in our repo, So I though this may be something you could review.

@alessbell
Copy link
Member

@jpvajda yep, this has the intended effect. The only thing I'd note is that we removed Prettier from the repo 2 years ago (#5227), so adding this ignore file only affects those who have a Prettier plugin installed via IDE extension configured to format on save and don't want to have to manually 'save without formatting' (or disable their Prettier plugin).

@jpvajda
Copy link
Contributor Author

jpvajda commented Jun 24, 2022

@alessbell 👋

so adding this ignore file only affects those who have a Prettier plugin installed via IDE extension configured to format on save and don't want to have to manually 'save without formatting' (or disable their Prettier plugin).

yes, that would be the intention with this change. 😄 This actually is my exact use case as well. I notice the Circle CI test is now failing so let me do a rebase on this branch and see if that fixes the test failure.

@alessbell
Copy link
Member

yes, that would be the intention with this change. 😄 This actually is my exact use case as well

Sounds good to me 👍

I notice the Circle CI test is now failing so let me do a rebase on this branch and see if that fixes the test failure.

FWIW I had a test fail when I opened a PR just now and I just had to click the re-run button via the web UI for them to pass

@jpvajda jpvajda merged commit df6b315 into main Jun 24, 2022
@jpvajda jpvajda deleted the prettier-ignore branch June 24, 2022 19:51
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide repo level settings for prettier to prevent overwriting of code standards
3 participants