robatwilliams / es-compat

Check JavaScript code compatibility with target runtime environments
MIT License
65 stars 13 forks source link

ES2021 #33

Closed robatwilliams closed 2 years ago

robatwilliams commented 2 years ago

New features e.g. logical assignment, promise.any

https://eslint-plugin-es.mysticatea.dev/

https://v8.dev/features/tags/es2021

https://exploringjs.com/impatient-js/ch_new-javascript-features.html#new-in-es2021

lukeapage commented 2 years ago

replaceAll caught us out this week and is in 2021.

Is this issue to support catching 2021 features in the source ?

robatwilliams commented 2 years ago

Yes.

It should be straightforward if one of you wants to do it - essentially it's do for 2021 the same as I did in older PRs/commits for the other ES versions e.g. https://github.com/robatwilliams/es-compat/commit/92d559665298ca5c218ca39140098ca7533a6c47.

  1. Add ES2021 to this table https://github.com/robatwilliams/es-compat/blob/master/packages/eslint-plugin-ecmascript-compat/lib/features/es-versions.md - happy to review this first as a draft PR if there's anything non-obvious
  2. Add all the 2021 stuff here like the others https://github.com/robatwilliams/es-compat/tree/master/packages/eslint-plugin-ecmascript-compat/lib/features
  3. Update ecmaVersion in eslint parser options to 2021
  4. Search the whole repo for "2020" as there may be others I don't remember
  5. Add test cases to the example project (this is used to sanity check the CLI tool's config)
  6. Run all the checks as per contributing.md
  7. Update the readme
robatwilliams commented 2 years ago

released - https://github.com/robatwilliams/es-compat/releases/tag/v2.1.0