-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check scripts required by entrypoint script #2
Comments
Hey there @obahareth! I believe that I'm actually running into this issue now! One of my dependencies is the In I'm also not entirely sure how you would check this, but I'll put my brain to it and see if I can help at all! Thanks so much for |
Hey, I think I am running into the same issue. I currently depend on a package that uses es6 features but does not use the es6 module system. However, implementing checks for imported files is non-trival. Since you somehow have to find out what file is being imported. Basically you would have to walk the syntax-tree generated by acorn and then check for import statements, So far so simple, however if someone aliases the "require" function like Another problem would be that dynamic If you really wanted to implement this though, you could deal with these problems by saying that if a function named "require" is used or a "require" call is dynamically constructed, we just treat it as ES6. This could cause errors if someone relies on this to be 100% accurate. However, this module is mostly used in conjunction with babel to build a regex so including a module that is not really es6 is not be as big a deal. I don't know if there are other ways of importing a script. There probably is... (Example: read file from fs, then use Therefore I suggest we only focus on "require". If you do intend to implement this. |
Based on the issues with a couple of packages (#48, #53, #24), we need to check more than just the entry script. Right now we only check the entrypoint script, we need to check scripts required/imported by the entrypoint (up to a certain depth) to provide a more conclusive result. This is a bit difficult and I don't know how to do it in a way that works for all JavaScript engines (the different JS module formats,
import
vsrequire
, etc.)The text was updated successfully, but these errors were encountered: