[go: up one dir, main page]

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

No more env: browser? #1002

Closed
tleunen opened this issue Aug 6, 2016 · 5 comments
Closed

No more env: browser? #1002

tleunen opened this issue Aug 6, 2016 · 5 comments
Labels

Comments

@tleunen
Copy link
tleunen commented Aug 6, 2016

Did something change recently in the env configuration?

I just updated to the latest version in one project and I'm getting a lot of error 'document' is not defined no-undef.

This is resolved when I manually set the "browser" env in my config but I wonder why it's not done automatically here instead, like it used to be.

@ljharb
Copy link
Collaborator
ljharb commented Aug 6, 2016

Which package - eslint-config-airbnb, or eslint-config-airbnb-base?

@ljharb
Copy link
Collaborator
ljharb commented Aug 6, 2016

It looks like v3 of eslint-config-airbnb-base did supply the env via "legacy" (https://npmcdn.com/eslint-config-airbnb-base@3.0.1/index.js) but v4 of that package no longer did so (https://npmcdn.com/eslint-config-airbnb-base@4.0.2/index.js).

That seems like a reasonable thing to reintroduce to the base config, which would eventually make its way back to the main config.

However, it's also true that all top-level apps should be defining their own "env" values anyways, so perhaps its best to keep them unspecified?

@tleunen
Copy link
Author
tleunen commented Aug 7, 2016

So I'm updating from v9.0.1 to v10.0.0 on the main config.
9.0.1 uses the base v3. And 10.0.0 uses base v5.

I can understand why this disappeared from the base configuration (often used for Node application), but React runs in the browser in the end, so maybe it would be a good thing to reintroduce it in the main config only?

Also, why a top level app should define their own env? I used to only use what your config provides and overrides the "mocha" value in my tests only. But if you decide to not add it back to the config, I can specify them myself. No worries :)

@ljharb
Copy link
Collaborator
ljharb commented Aug 7, 2016

Our React runs in both the browser and node, and our app sets both envs to true in its top-level config.

The top-level app is the only thing that truly knows its own environment - node, browser, tests, amd, etc.

I'm not opposed to adding it back, but the more I think about it, the more I think it's not a shareable config's job to set them.

@tleunen
Copy link
Author
tleunen commented Aug 7, 2016

Agreed. Thanks :)

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

No branches or pull requests

2 participants