nsqadmin: upgrade supported ECMAScript from ES5 to ES2020 in ESLint. #1470
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The nsqadmin ESLint configuration leaves the ECMAScript version unspecified which means it defaults to ES5. ES5 was a sensible default many years ago since nsqadmin doesn't transpile its JS nor are their polyfills for missing ECMAScript functionality.
That said, it's 2023 and modern browsers support vast majority of features from ES2020 and earlier for several years. ES2020 contains the many of the language features that you'd use on a daily basis in modern JS development.
Concrete numbers in terms of world wide adoption can be seen here:
https://caniuse.com/?search=es2020
In addition to adding
es2020
to the environment list, thespace-before-function-paren
rule has been updated with the inclusion of async anonymous arrow functions.Without the rule change:
Generally, space is provided between the function modifier and the anonymous arrow function so that it does read as if async is the function name.
With the rule change: