You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, I want to share that I'm really stoked about this new --checkFeatures flag, I've tried setting up something similar in the past and stopped when I realised how much work this would be.
Requested Update
If even remotely possible it'd be nice if the --checkFeatures flag would take polyfills like core-js into account.
Why Is This Update Needed?
We're using core-js to polyfill certain ES features such as Array.prototype.toSorted() but when trying out the new --checkFeatures we noticed that this triggers an error when running es-check with es2022.
This might be vastly more complicated than one would initially think as in our setup we load the polyfill in a different file (chunk) than where .toSorted() is being called. Additionally there's of course a plethora of different polyfills and trying to even detect some of them might result in a lot of work. Maybe alternative ways of doing this can be thought of.
Are There Examples Of This Requested Update Elsewhere?
Not that we could find 🤷🏼♂️
The text was updated successfully, but these errors were encountered:
(I could imagine it might work even in 1996 LiveScript…? Maybe the array needs to be created differently, though.)
I understand this might be difficult to implement (I know very little about AST parsing) – so is it out of scope of this utility?
cascornelissen
changed the title
Possibility of detecting polyfills with the --detectFeatures flag
Possibility of detecting polyfills with the --checkFeatures flag
Jan 14, 2025
First of all, I want to share that I'm really stoked about this new
--checkFeatures
flag, I've tried setting up something similar in the past and stopped when I realised how much work this would be.Requested Update
If even remotely possible it'd be nice if the
--checkFeatures
flag would take polyfills like core-js into account.Why Is This Update Needed?
We're using core-js to polyfill certain ES features such as
Array.prototype.toSorted()
but when trying out the new--checkFeatures
we noticed that this triggers an error when runninges-check
withes2022
.This might be vastly more complicated than one would initially think as in our setup we load the polyfill in a different file (chunk) than where
.toSorted()
is being called. Additionally there's of course a plethora of different polyfills and trying to even detect some of them might result in a lot of work. Maybe alternative ways of doing this can be thought of.Are There Examples Of This Requested Update Elsewhere?
Not that we could find 🤷🏼♂️
The text was updated successfully, but these errors were encountered: