Prevent usage of NODE_ENV
npm install eslint-plugin-no-node-envPrevent usage of process.env.NODE_ENV, which is probably not what you think it is. Read more context here.
``sh`
npm install eslint-plugin-no-node-env --save-dev
Add no-node-env to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix. Then include the rule in the rules section:
`json`
{
"plugins": ["no-node-env"],
"rules": {
"no-node-env/no-node-env": "error"
}
}
To only apply this rule to a subdirectory, like src, you can use the overrides section of your ESLint configuration file.
`json``
{
"overrides": [
{
"plugins": ["no-node-env"],
"files": ["src/**"],
"rules": {
"no-node-env/no-node-env": "error"
}
}
]
}
| Name |
| :--------------------------------------- |
| no-node-env |