Skip to content
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

Add a NODE_ENV configuration setting for eslint #988

Merged
merged 9 commits into from
Jul 31, 2020

Conversation

mattlubner
Copy link
Contributor

Addresses #983

@ghost
Copy link

ghost commented Jun 8, 2020

CLA assistant check
All CLA requirements met.

@mattlubner
Copy link
Contributor Author

Hey @dbaeumer, is there anything I can do to help expedite getting this PR reviewed / merged? 🙂

@mattlubner
Copy link
Contributor Author

@dbaeumer Could you review my changes when you get a chance?

I'm really eager to get these changes merged & published, as the only way I can use VSCode at work right now is via the [Extension Development Host] VSCode window spawned by the "Launch Client" launch configuration of this plugin. It works, but it feels silly! 😅

@mattlubner
Copy link
Contributor Author

@dbaeumer Could you take a look? I believe I've made all of the requested changes.

@mattlubner
Copy link
Contributor Author

@dbaeumer Are we good to merge this?

@mattlubner
Copy link
Contributor Author

@dbaeumer @Hirse I noticed the repo ownership changed since I opened this PR… is there anything I can do to get this merged and released? As far as I can tell, it's good to go.

@mattlubner
Copy link
Contributor Author

@dbaeumer Sorry to keep nagging, but it's been over a month since I made the changes you requested! Did I miss anything? I'd really like to get this PR merged! 🙏🙏

@mattlubner
Copy link
Contributor Author

I've merged the latest upstream changes into the PR branch, and verified that everything is working as expected.

@mattlubner
Copy link
Contributor Author

I'd really appreciate some feedback regarding this PR!

By the way, the change requested is on a line that's unaffected by the actual change, which might be why GitHub isn't showing that PR comment as "outdated".

@dbaeumer dbaeumer merged commit ea6f436 into microsoft:master Jul 31, 2020
@dbaeumer
Copy link
Member

I merged it in but changed env back to let env: { [key: string]: string | number | boolean }. Was there a deeper reason why you remove number and boolean and added undefined. We should not allow undefined as a value in env when setting.

@mattlubner
Copy link
Contributor Author

Thanks!! It's been awhile, but I think I made that change because I saw a type error when running the extension in debug mode? I've gotten to know TypeScript a lot better since I wrote that though, I agree that including undefined was a mistake. Although NodeJs doesn't allow process.env to contain values other than string - such values are just coerced to string though, so it's not that big of a deal.

Thanks again!

@mattlubner mattlubner deleted the fix/node-env branch July 31, 2020 18:43
chemzqm added a commit to neoclide/coc-eslint that referenced this pull request Sep 10, 2020
@ethanyou725
Copy link

@mattlubner would you mind provide a default value for NODE_ENV configuration ?
I have met an issue with [email protected] and ejected
debug info:

2022-02-02T09:24:47.689Z eslint:cli-engine Lint /Users/yzg/workspace/test/react-rxjs/src/index.js
2022-02-02T09:24:47.689Z eslint:linter Linting code for /Users/yzg/workspace/test/react-rxjs/src/index.js (pass 1)
2022-02-02T09:24:47.689Z eslint:linter Verify
2022-02-02T09:24:47.689Z eslint:linter With ConfigArray: /Users/yzg/workspace/test/react-rxjs/src/index.js
2022-02-02T09:24:47.693Z eslint:linter Parsing error: [BABEL] /Users/yzg/workspace/test/react-rxjs/src/index.js: Using `babel-preset-react-app` requires that you specify `NODE_ENV` or `BABEL_ENV` environment variables. Valid values are "development", "test", and "production". Instead, received: undefined. (While processing: "/Users/yzg/workspace/test/react-rxjs/node_modules/babel-preset-react-app/index.js")
Error: [BABEL] /Users/yzg/workspace/test/react-rxjs/src/index.js: Using `babel-preset-react-app` requires that you specify `NODE_ENV` or `BABEL_ENV` environment variables. Valid values are "development", "test", and "production". Instead, received: undefined. (While processing: "/Users/yzg/workspace/test/react-rxjs/node_modules/babel-preset-react-app/index.js")
    at module.exports (/Users/yzg/workspace/test/react-rxjs/node_modules/babel-preset-react-app/create.js:58:11)
    at module.exports (/Users/yzg/workspace/test/react-rxjs/node_modules/babel-preset-react-app/index.js:19:10)
    at sync (/Users/yzg/workspace/test/react-rxjs/node_modules/@babel/core/lib/gensync-utils/async.js:38:25)
    at sync (/Users/yzg/workspace/test/react-rxjs/node_modules/gensync/index.js:182:19)
    at /Users/yzg/workspace/test/react-rxjs/node_modules/gensync/index.js:210:24
    at Generator.next (<anonymous>)
    at /Users/yzg/workspace/test/react-rxjs/node_modules/@babel/core/lib/config/full.js:217:21
    at Generator.next (<anonymous>)
    at Function.<anonymous> (/Users/yzg/workspace/test/react-rxjs/node_modules/@babel/core/lib/gensync-utils/async.js:25:3)
    at Generator.next (<anonymous>)

https://github.com/facebook/create-react-app/blob/main/packages/babel-preset-react-app/create.js#L57
if there is no NODE_ENV setted, it will throw an error, I think set to NODE_ENV=development as default might fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants