Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

looking forward to updating more .gitignores with 3 of these 4

  package-lock.json
  yarn.lock
  deno.lock
  bun.lock


This is an underrated and misunderstood comment.

Let me explain: projects usually support only one package manager. In a world of N competing JS package managers, you need to ban lock files from N-1 of them.


Can't forget pnpm-lock.yaml ;)


I use pnpm the most and I missed this :O


Why would you gitignore those? Adding lockfiles to git repositories is considered good practice


I said 3 out of 4 of these. Committing multiple lockfiles is not good practice but I see people that struggle with the idea that package managers are not interchangeable all the time


Surely you would enforce this at pull request time, no? Ignoring the file works from a functional perspective, yes, but does nothing to solve the actual problem.


the "actual problem" is often management trying to find cheap labor or even using AI to "do it themselves"


If someone commits a wrong lockfile they are fired where I work at lol (exaggerating, but only slightly)


And why would they use multiple competing package managers and runtimes? It isn't a good faith comment.


> And why would they use multiple competing package managers and runtimes?

Some of us work across multiple projects and aren't up in our arms about what package manager the current project use. Some days you touch 3-4 projects that happen to all use different package managers.


It’s not just good practice it’s the whole point




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: