Skip to content

Remove requirement for NODE_ENV "NODE_ENV environment variable is required but was not specified" #10195

@caub

Description

@caub

Is your proposal related to a problem?

Yes, NODE_ENV is required here: https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/config/env.js#L21

We have a custom local .eslintrc file, and the current behavior prevent us from running eslint as an extension in vscode, which is quite annoying

we can still run eslint from command-line, but with prefixing NODE_ENV env var, like: NODE_ENV=local npx eslint . though

In our .eslintrc, we use

"settings": {
    "import/resolver": {
      "webpack": {
        "config": "./node_modules/react-scripts/config/webpack.config.js"
      }
    }
  },

which is probably why this react-script warning shows up

Describe the solution you'd like

We propose to simply drop the NODE_ENV requirement (dropping the assertion), we think only the project local eslint configuration should be used anyway, similarly to root: true option in eslint https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions