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 all dotfiles with a .env prefix by default for new projects #2904

Closed
kellenmace opened this issue Nov 24, 2021 · 0 comments · Fixed by #2905
Closed

Ignore all dotfiles with a .env prefix by default for new projects #2904

kellenmace opened this issue Nov 24, 2021 · 0 comments · Fixed by #2905

Comments

@kellenmace
Copy link
Contributor

kellenmace commented Nov 24, 2021

Describe the problem

When a developer runs npm init svelte@next to create a new app and selects either the demo or skeleton project, the codebase generated for them contains a .gitignore file that will ignore a file that is named .env, but will not ignore env files with other names, such as the commonly used .env.local.

This makes it easy for developers to add their environment variables in a .env.local file, work on their project, then accidentally commit all the files for their project to git without realizing that their .env.local (and the potentially sensitive API keys therein) was included in the commit.

Describe the proposed solution

Add a .env.* line to the .gitignore files of the create-svelte package templates. This way, all files with a ".env." prefix will be git ignored by default, including .env.local.

Alternatives considered

n/a

Importance

nice to have

Additional Information

n/a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant