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

Add prettier and format files #371

Closed
wants to merge 0 commits into from
Closed

Conversation

lorenzolewis
Copy link
Contributor

What kind of changes does this PR include?

  • Changes to Starlight code

Description

  • Add prettier and prettier-plugin-astro
  • Add prettier config (based on the main Astro repo)
  • Format all files in repo

@changeset-bot
Copy link

changeset-bot bot commented Jul 21, 2023

⚠️ No Changeset found

Latest commit: b0224d7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented Jul 21, 2023

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit b0224d7
🔍 Latest deploy log https://app.netlify.com/sites/astro-starlight/deploys/64befa0652abe000086ac900
😎 Deploy Preview https://deploy-preview-371--astro-starlight.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 configuration.

@github-actions github-actions bot added 🚨 action Changes to GitHub Action workflows i18n Anything to do with internationalization & translation efforts 📚 docs Documentation website changes 🌟 core Changes to Starlight’s main package labels Jul 21, 2023
@HiDeoo
Copy link
Member

HiDeoo commented Jul 21, 2023

The plugin autoloading feature from Prettier was removed in v3 and the Prettier configuration file does not explicitly specify the Prettier plugin for Astro so I don't think it's running on Astro files (which may be why the diff does not contain any Astro file changes).

Altho, I do not think specifying the plugin in the config would be enough as there is currently a bug in Prettier where you have to manually specify the files handled by a plugin for it to format these files, e.g. prettier --write **/*.astro.

I wonder if it would not be wise to wait until this issue is fixed before introducing Prettier to the codebase?

@lorenzolewis
Copy link
Contributor Author

Thanks @HiDeoo , didn't even think to double-check the Astro files.

I updated the prettier config to include the plugin and added a format script that will at least catch it all (from what I can tell). Also got all those *.astro files formatted.

Completely understand if you want to hold off on this until prettier/prettier#15079 / withastro/prettier-plugin-astro#334 (comment) are resolved.

Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Thanks for this @lorenzolewis! Left a few observations. And… of course this is now conflicting 😅 Hopefully easy enough to resolve by reverting the formatting, updating branch, and then re-formatting?

pnpm-lock.yaml Outdated Show resolved Hide resolved
docs/src/content/docs/es/guides/components.mdx Outdated Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

Looking at the code samples now they’re using tabs, we should probably set tab-size for Starlight code blocks.

We can do it in a follow-up PR though so we’re not mixing formatting with meaningful code changes.

docs/src/content/docs/fr/reference/configuration.md Outdated Show resolved Hide resolved
@lorenzolewis lorenzolewis force-pushed the main branch 2 times, most recently from 701e3a4 to b0224d7 Compare July 24, 2023 22:24
@lorenzolewis
Copy link
Contributor Author

I found another magical button on GitHub that apparently closed this one 😅 I'll re-open another one with the suggestions included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 action Changes to GitHub Action workflows 🌟 core Changes to Starlight’s main package 📚 docs Documentation website changes i18n Anything to do with internationalization & translation efforts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants