8000 Exclude `pnpm-lock.yaml` when expanding directory by fisker · Pull Request #18710 · prettier/prettier · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@fisker
Copy link
Member
@fisker fisker commented Jan 21, 2026

Description

Only exclude when expanding directory.

  1. I didn't forbid it in inferParser, since it's awkward if it's passed explicitly.
$ prettier pnpm-lock.yaml
[error] No parser could be inferred for file "/path/to/pnpm-lock.yaml".

and prettier "**/*.yaml" will throw error for no parser can be inferred.

  1. Didn't add to ignore pattern, otherwise user won't able to format it. And I don't want introduce another flag like --with-node-modules.

Note to myself, should implement in https://github.com/prettier/prettier-cli too.

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.

@pkg-pr-new
Copy link
pkg-pr-new bot commented Jan 21, 2026

Open in StackBlitz

yarn add https://pkg.pr.new/@prettier/plugin-hermes@18710.tgz
yarn add https://pkg.pr.new/@prettier/plugin-oxc@18710.tgz
yarn add https://pkg.pr.new/prettier@18710.tgz

commit: ab76502

@netlify
Copy link
netlify bot commented Jan 21, 2026

Deploy Preview for prettier ready!

Name Link
🔨 Latest commit ab76502
🔍 Latest deploy log https://app.netlify.com/projects/prettier/deploys/69712f9cbd36150008716aa0
😎 Deploy Preview https://deploy-preview-18710--prettier.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 project configuration.

@fisker
Copy link
Member Author
fisker commented Jan 21, 2026

@kachkaev You are involved in a few related issues. What do you think?

I'm little worried about git hooks, since the path is passed explicitly.
Open to better solutions.

@fisker fisker marked this pull request as ready for review January 21, 2026 19:52
@fisker
Copy link
Member Author
fisker commented Jan 21, 2026

Another question, people seems also ignoring package-lock.json file, but as I tested, we format the same as NPM, not sure if we need add it.

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.

1 participant

0