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

feat: add support for package.yaml config #16157

Merged
merged 3 commits into from May 10, 2024

Conversation

danielbayley
Copy link
Contributor

@danielbayley danielbayley commented Mar 19, 2024

Description

Enable support for reading prettier configuration directly from package.yaml.

Checklist

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory).
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

@danielbayley danielbayley marked this pull request as draft March 19, 2024 00:32
@danielbayley danielbayley marked this pull request as ready for review March 19, 2024 01:04
@sosukesuzuki
Copy link
Member

I did not know this pnpm feature. Is there any official documentation? Or are there other tools besides pnpm that support this format?

@danielbayley
Copy link
Contributor Author

Is there any official documentation?

@sosukesuzuki See pnpm/pnpm.io#487.

are there other tools besides pnpm that support this format?

Support has already been added to lint-staged, cosmiconfig, and commitlint, so far…

@fisker
Copy link
Sponsor Member

fisker commented Apr 4, 2024

So, we have to support package.json5 too?

@danielbayley
Copy link
Contributor Author

So, we have to support package.json5 too?

@fisker Not as far as I’m concerned. I don’t personally see the point of JSON with comments, when YAML is available… Maybe ideally as an option it should, but that would be for a separate PR anyway…

@fisker
Copy link
Sponsor Member

fisker commented Apr 4, 2024

that would be for a separate PR anyway…

Sounds good.

@danielbayley danielbayley force-pushed the package-yaml branch 2 times, most recently from 138515f to 031fa8c Compare April 10, 2024 23:17
src/config/prettier-config/config-searcher.js Outdated Show resolved Hide resolved
src/config/prettier-config/load-config.js Outdated Show resolved Hide resolved
Copy link
Sponsor Member

@fisker fisker left a comment

Choose a reason for hiding this comment

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

Just noticed there is no test for it yet.

@fisker fisker merged commit da772ff into prettier:main May 10, 2024
28 checks passed
@danielbayley danielbayley deleted the package-yaml branch May 10, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants