envalid icon indicating copy to clipboard operation
envalid copied to clipboard

[improvement]: warn about extra environment variables

Open gugu opened this issue 3 months ago • 2 comments

Hi!

We use envalid almost everywhere and it made our env usage much better. The only missing option is ability to warn about provided, but unused environment variables.

This warning can be optional and exclude $HOME, $USER and other default variables.

Example of warning:

Environment contains extra variables: OPENAI_KEY, OLD_SECRET,.... Remove these variables or add them to exclusion list

Please tell if you think if this feature can be useful in this package

gugu avatar Nov 27 '25 08:11 gugu

Cool idea! I don't think I would include this in the core package (trying to keep it as lean as possible) but I would love to see this implemented as a middleware and posted in this ticket for future reference, I'm sure others would find it valuable

af avatar Nov 28 '25 14:11 af

Implemented by Claude Code

https://github.com/Short-io/envalid-unused / https://www.npmjs.com/package/envalid-unused

gugu avatar Nov 29 '25 21:11 gugu