False recursive reference
Anyone know how I can get past this false positive claiming I'm recursively referencing process.env in its base type? Since the value is just being used to compute the base type, not in the actual base type, this should be okay.
1 Reply
TS struggles with this a bit since it's trying to use the inferred type for the
process.env.NODE_ENV
check. You can work around this by casting process.env
on that line:
If you don't want to use any you can use Record<string, string | undefined>
or create a RawProcessEnv
type, but it's pretty harmless in a case like this where it's can't propagate outside that single statement.