-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Rethink this package #82
Comments
Agreed. On the ESLint side, I would encourage people in a blog post to create ESLint plugins for the environments that are going to be removed. |
Yeah, we'll definitely do that before the next breaking release. In the meantime, I'd propose that we stop adding new environments in this package and always direct people to create ESLint plugins with the appropriate environments instead. |
Agree with the env plugin approach so in our rules we can check against the rules configured by the eslint user. |
Some of the environments in this package (including, for example, prototype) seem to still be for specific libraries and platforms that have extra stuff outside of the ES specs. What is the plan for this? I think it would make sense to have a major version bump which would document what determines an official ES environment, remove all the globals for noncompliant libraries, and extract them into other packages. |
@nicolasmccurdy we haven't started down this path yet, it's going to take a lot of coordination with ESLint to do this in a way that is least disruptive for users. I don't have the time to do that yet. For your last question/statement, I answered that in the original description:
|
Would there be consideration for a breaking change PR that removes all the globals not desired? Specifically, such a PR would remove: |
@MatthewHerbst Not until there are ESLint plugins for them that covers them and it's coordinated with a major release of ESLint. No rush though. It's not like they're a big burden. |
@sindresorhus they are and they aren't - I'd like to propose a major change to how the globals in this lib are organized so as to support solving: eslint/eslint#9109 Basically, I want to generate the JSON output using some JS that builds which globals belong in which category. So for example, it would know to fill an "es2017" key with all the globals from the ones before it, that way solving the ESLint config issue without having to continue the duplications of keys in this lib. Imho, each key should be defined once and have a config object listing which categories it belongs to. |
Yes, I agree it doesn't make sense to manually duplicate them. |
@sindresorhus Can you pin this issue? Reference |
Some initial attempts at generating the globals: |
@sindresorhus @nzakas does this stance still hold now that flat config has shipped, and the docs point users to this package as a recommended way to add globals? My ulterior motive: I came here because I was surprised to see that react globals aren't included. I didn't want to create an issue/PR for them since this is still linked to in the readme. React is not "my favourite library", but it's hard to get away from, is the fourth-most used npm package that exists, and it uses (type-level) globals even in modern code. (e.g. Note: it is possible to make a plugin even for this use case. But that would require the 66 million people who download this package per week to install another plugin just so they can get |
This issue was opened 8 years ago and I can't remember all the ins and outs of why. Going forward, ESLint won't be bundling |
Then I think it's ok to close this. We will consider new environments if there is a lot of demand for it. |
In the beginning, I think the purpose of this package was to have a single location where the commonly-used globals for JavaScript lived, with the idea that other tools could make use of it.
What we've been seeing, though, is that most requests for new environments come from ESLint users who want an environment for their favorite library. This ends up breaking the feedback cycle where people file issues here instead of with ESLint, meaning the ESLint team doesn't even see them.
Given that ESLint now supports plugins with custom environments, I think we should re-think the goals of this project. Maintaining a list of every library's global objects is something I'm really not interested in doing, and realistically, in the future we'll only care about the ES environment globals because everyone will be using modules, so library-specific globals will be going away.
I'm thinking that maybe this package should be repurposed to just be ES language versions, browser globals, and Node.js globals, and leave the rest to others.
Thoughts?
The text was updated successfully, but these errors were encountered: