r/node • • 4d ago

.gitignore everything by default

https://packagemain.tech/p/gitignore-everything-by-default
0 Upvotes

18 comments sorted by

14

u/GoodishCoder 4d ago

This is going to cause way more issues than it prevents.

A code reviewer should know what doesn't belong in source control. A code reviewer should not know what local files you have forgotten to allow into source control.

1

u/better_work 3d ago

In many stacks/setups, the project will not build in CI if a needed file cannot be found. This requires some thinking about your context of course: if you have a plain web project with <img> tags, probably you won't be able to tell at build time that an image resource was not committed. If you have a Next project with bundler support, that's not an issue.

If you can determine that commits missing files won't pass CI, or make it so, then the reviewer never has to catch anything, which IMO is better.

1

u/GoodishCoder 3d ago

Most companies I have worked for don't build in CI, they wait to build until CD. That ultimately means it's going to be another PR to fix.

You're creating a worse situation to avoid a small number of excludes. Gitignore isn't typically a large file. If someone came to you and said hey to avoid wasting 20 minutes of dev time every 5-6 years, we are going to create a process that adds 20 minutes a day, would you say that sounds great?

1

u/better_work 3d ago

You don't run typechecking in CI?

1

u/GoodishCoder 3d ago

We don't run builds in CI

1

u/BenZed 3d ago

Why??

1

u/GoodishCoder 3d ago

Cost and efficiency.

1

u/better_work 3d ago

If you run typechecking in CI, then you can probably determine that commits missing files won't pass CI, as I said.

2

u/GoodishCoder 3d ago

Not every language has type checking to run.

1

u/LowLifeArcade 1d ago

That sounds insane tbh

1

u/GoodishCoder 1d ago

It's pretty standard to wait until CD to build if you don't have quick builds. Especially for something like a monorepo.

7

u/shamshuipopo 4d ago

lol that’s a new level of dumb

4

u/BenZed 4d ago

I think this person just wanted to write an article that included a wild take.

1

u/LowLifeArcade 1d ago

I'm not against this

1

u/Empty-Lobster6138 4d ago

Wildcard? *