From ESLint docs:
An environment provides predefined global variables. The available environments are:
- es6 - enable all ECMAScript 6 features except for modules (this automatically sets the ecmaVersion parser option to 6).
- es2017 - adds all ECMAScript 2017 globals and automatically sets the ecmaVersion parser option to 8.
- es2020 - adds all ECMAScript 2020 globals and automatically sets the ecmaVersion parser option to 11.
- es2021 - adds all ECMAScript 2021 globals and automatically sets the ecmaVersion parser option to 12.
For es2017, es2020, es2021 it says that they "add" new globals, but it does not say if they include globals from previous versions.
When configuring ESLint, should I include all of them or only the last one would be enough.
"parserOptions": {
"ecmaVersion": "latest"
},
"env": {
"es2021": true
},