.env is an anti-pattern to me, because it requires overhead to keep it secure.
It seems to be quite a popular anti-pattern nowadays. 😅
Besides, adding one line to the .gitignore file shouldn't be that much of an overhead.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.