ESLint has global settings from all environments:
{
"env": {
"es6": true,
"es2017": true,
"es2020": true
}
}
Are the ESLint globals from all environments es6, es2017, and es2020 cumulative or incremental settings?
In other words, is it enough to enable es2020 support to benefit from es6 and es2017 as well, or it is mandatory to enable each JS language version support separately?
Yes, the environments are cumulative.
This can be best seen by looking at the relevant part of the source code (linking to the current master version on GitHub).
es6 includes only the globals defined in newGlobals2015. es2017 includes newGlobals2015 and newGlobals2017, while es2020 includes newGlobals2015, newGlobals2017 and newGlobals2020.
Update
Newer versions of ESLint depend on environments defined in a separate package, which uses a different structure (it's a plain JSON file). In the end though, the global definitions haven't changed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With