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

.gitignore generated from create-nx-workspace allows nested node_modules to be committed #9412

Closed
melanieseltzer opened this issue Mar 19, 2022 · 3 comments · Fixed by #9544
Labels
community This is a good first issue for contributing outdated scope: misc Misc issues type: bug

Comments

@melanieseltzer
Copy link
Contributor

melanieseltzer commented Mar 19, 2022

It's maybe not a bug, per se, but more like a question of whether it's intentional / could be improved?

Current Behavior

The .gitignore that is generated from create-nx-workspace has an entry for node_modules like /node_modules (note the leading slash). This means that the pattern is scoped to the directory level of the .gitignore (only ignores node_modules at the same level of the .gitignore).

I'm using Nx along with Yarn workspaces, and some nested node_modules ended up being committed, i.e. melanieseltzer/toolkit@042d4ce

Was wondering if the leading slash is intentional, or maybe it would be better not to include it in the generated .gitignore to prevent this behavior on accident?

Expected Behavior

.gitignore ignores all node_modules regardless of nesting level.

@FrozenPandaz FrozenPandaz added scope: misc Misc issues community This is a good first issue for contributing labels Mar 25, 2022
@FrozenPandaz
Copy link
Collaborator

I agree. There's no reason not to ignore all node_modules directories. Would you like to contribute the change?

@melanieseltzer
Copy link
Contributor Author

Great! Yes, I'd be happy to make the change :)

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community This is a good first issue for contributing outdated scope: misc Misc issues type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants