sindresorhus / globals

Global identifiers from different JavaScript environments
MIT License
404 stars 116 forks source link

Copy missing globals from `builtin` to `es*` #140

Open silverwind opened 6 years ago

silverwind commented 6 years ago

While investigating why eslint wouldn't pick up the BigInt globals, I noticed eslint does not use builtin like I previously assumed. I'd like to propose to copy any globals missing in either es5, es2015, es2017 but present in builtin to one of those respective environments.

Afterwards, I'd copy back any potential globals from the es* categories to builtin so that it ends up containing all globals from those categories. Alternatively, builtincould be generated dynamically in index.js, I think actually, that'd be my preference to avoid future inconsistency.

silverwind commented 6 years ago

Alternatively, we could also drop builtin which serves no clear purpose in my eyes. Nowadays, es5 should be considered as the baseline.

sindresorhus commented 4 years ago

If anyone wants to work on this, see the initial attempt and feedback in https://github.com/sindresorhus/globals/pull/158.

fisker commented 4 months ago

This already fixed, tests https://github.com/sindresorhus/globals/blob/d4082e22e522ffde7b3e242f6815323d00aee284/test.mjs#L62-L88

About dripping "builtin", see https://github.com/sindresorhus/globals/pull/158#issuecomment-587225993 add https://github.com/sindresorhus/globals/pull/252#issuecomment-2153089306, let's keep it.

But do you think we should name it as "es-latest"?