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

ignore pnpm-lock.yaml by default #14517

Closed
stefanprobst opened this issue Mar 17, 2023 · 2 comments
Closed

ignore pnpm-lock.yaml by default #14517

stefanprobst opened this issue Mar 17, 2023 · 2 comments
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:duplicate Issues that are a duplicate of a previous issue

Comments

@stefanprobst
Copy link

Environments:

  • Prettier Version: 2.8.4
  • Running Prettier via: CLI
  • Runtime: Node.js v18.15
  • Operating System: Linux
  • Prettier plugins (if any):

Steps to reproduce:

  • pnpm init
  • pnpm add prettier
  • pnpm dlx prettier . --check

Expected behavior:

ignore pnpm-lock.yaml when running prettier

Actual behavior:

prettier by default tries to format pnpm-lock.yaml

@kachkaev
Copy link
Member

Current implementation of Prettier’s ignore logic does not contain any any special ignore rules except for node_modules. Ignoring common file patterns like pnpm-lock.yaml, .yarn/*, etc., may feel like a simple and good solution, but I’m not sure about that. Once we’ve ignored these ‘obvious’ patterns, what should we do, say, with a feature request to ignore .next/* too (Next.js output)? This app framework is very popular.

The issue has already been discussed in #4547, so I am going to close this one as a duplicate.

I my opinion, What we should probably do instead is introduce composable ignore patterns, similar to what’s possible in ESLint with ignorePatterns. See #4708 and #7073 (there could be other related issues, but I could not find them today).

@kachkaev kachkaev closed this as not planned Won't fix, can't repro, duplicate, stale Mar 19, 2023
@kachkaev kachkaev added the type:duplicate Issues that are a duplicate of a previous issue label Mar 19, 2023
@SevenOutman
Copy link
Contributor

Current implementation of Prettier’s ignore logic does not contain any any special ignore rules except for node_modules. Ignoring common file patterns like pnpm-lock.yaml, .yarn/*, etc., may feel like a simple and good solution, but I’m not sure about that. Once we’ve ignored these ‘obvious’ patterns, what should we do, say, with a feature request to ignore .next/* too (Next.js output)? This app framework is very popular.

If pnpm-lock.yaml should be considered a "popular framework" thing rather than an "npm basic convention" (like node_modules) because its third-party after all, then what about package-lock.json? It's not ignored by default either. How's that less npm-native than node_modules?

@github-actions github-actions bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Nov 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:duplicate Issues that are a duplicate of a previous issue
Projects
None yet
Development

No branches or pull requests

3 participants