-
Notifications
You must be signed in to change notification settings - Fork 30.4k
Type of process.env should be { [key: string]: string } #11615
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
Comments
{ [key: string]: string }
I see what you mean. However, this request have a problem. const val: { [key: string]: string; } = { 'x': 'str', };
const x = val.x; This code reports error: const x: number = process.env['x']; // type error! There is a problem from compatibility, and it may be different from what you mean. Actually, I recommend this request. But, because many typescript users use syntax on their program such as |
May be related to microsoft/TypeScript#560 This definition partially solves this problem. Such code is correct on const path = process.env.PATH; However, this code is invalid: const x = process.env.x |
please send a pull request. I'll review it. |
…ion for process.env.
…ion for process.env.
Hi thread, we're moving DefinitelyTyped to use GitHub Discussions for conversations the To help with the transition, we're closing all issues which haven't had activity in the last 6 months, which includes this issue. If you think closing this issue is a mistake, please pop into the TypeScript Community Discord and mention the issue in the |
This will allow to typescript to trigger compile error :
See microsoft/TypeScript/issues/11239
The text was updated successfully, but these errors were encountered: