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
{{ message }}
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.
I was asked today if there was a tool to check if the transpiled code was ES5 and I referred to this project but I just checked and es-check es5 ... does not catch Promise from ES2015.
Why Is This Update Needed?
The reason I was asked is that they have continuous issues with bug reports because they forget to add polyfills to their projects. They need an automated way to check which polyfills they are missing from their transpiled code.
Are There Examples Of This Requested Update Elsewhere?
How did you write the script you tested with @dotnetCarpenter?
What version of ES Check were you using?
^ Questions asked to ensure it's not a potential feature that needs to be added.
ES-check is built on acorn.js. I trust it. There are new features that are popping up though. So perhaps feature detection will become a thing that es-check supports.
Es-feature-detection provides some interesting things that could potentially be provided by ES-Check. Thanks for sharing.
The ones for globals like Map and Set will require some keeping track of the variables. For a single file, this can probably be done by walking the syntax tree with acorn-walker or something similar and looking for uses while making sure that they are not shadowed by something else in the scope. Stuff in ESTree like Function, BlockStatement, WithStatement, VariableDeclaration, AssignmentExpression, Expression will need to be checked.
The story about new methods like Array.prototype.flatmap is a bit more frightening, since they are going to require type deduction and checking. An example of doing so is in the no-for-in-array rule of typescript-eslint. (Some more complex ones like await-thenable requries the tsutils package.) Acorn will not do: this linter uses a ESTree parser generated by consuming typescript AST to achieve that. On the other hand typescript compiler may be good for keeping track of global variables for you too, but it sure is a lot slower.
Requested Update
I was asked today if there was a tool to check if the transpiled code was ES5 and I referred to this project but I just checked and
es-check es5 ...
does not catchPromise
from ES2015.Why Is This Update Needed?
The reason I was asked is that they have continuous issues with bug reports because they forget to add polyfills to their projects. They need an automated way to check which polyfills they are missing from their transpiled code.
Are There Examples Of This Requested Update Elsewhere?
The text was updated successfully, but these errors were encountered: