eslint-plugin-n version
17.7.0
What problem do you want to solve?
It's common for bundlers to inline process.env.NODE_ENV and such, so that minifiers can do their job and eliminate dead code. Currently n/no-process-env takes issue with every use of process.env.NODE_ENV and I have to disable it manually. I don't want to disable it completely as I still want to encourage configuration validation. I can't import nodeEnv from ./config.js or something because some (all?) minifiers don't dig that far and will not eliminate any code wrapped in if (nodeEnv === "production") ....
What do you think is the correct solution?
Options:
- Add
allowNodeEnv, defaulting to false. Probably a bit simpler to implement and covers the majority of cases.
- Add
allowlist, defaulting to []. NODE_ENV is the behemoth, but there's a long tail of other variables.
Participation
Additional comments
No response
eslint-plugin-n version
17.7.0
What problem do you want to solve?
It's common for bundlers to inline
process.env.NODE_ENVand such, so that minifiers can do their job and eliminate dead code. Currentlyn/no-process-envtakes issue with every use ofprocess.env.NODE_ENVand I have to disable it manually. I don't want to disable it completely as I still want to encourage configuration validation. I can't importnodeEnvfrom./config.jsor something because some (all?) minifiers don't dig that far and will not eliminate any code wrapped inif (nodeEnv === "production") ....What do you think is the correct solution?
Options:
allowNodeEnv, defaulting tofalse. Probably a bit simpler to implement and covers the majority of cases.allowlist, defaulting to[].NODE_ENVis the behemoth, but there's a long tail of other variables.Participation
Additional comments
No response