-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
False 'unused dependency' for asyncawait. #259
Comments
Updates the issue templates to collect version information and example code. I failed to reproduce an issue today (#259), so it seems helpful to collect this information in general
…e code. I failed to reproduce an issue today (#259), so it seems helpful to collect this information in general
Our parser (Babylon) is throwing an error when it encounters I can't currently think of a way to fix this issue... Here are some things that won't work:
|
What if you built a step at the end that basically had a list of "packages to check". For each of those, if it finds, that it is unused, then it greps the project to quickly see if there is matching syntax (as i have shown in the issue ticket) and will remove it from the list of unused dependencies accordingly if it finds a match? |
Neat idea! We would need to handle lots of edge cases though, since there's lots of possible syntaxes that can be used for importing a module (e.g. I'm starting to think that the root issue here is that the Babylon parser has a fixed list of reserved words, no matter which ES version it is parsing. So even though using On the other hand, the Acorn parser can be configured to parse in ES5 mode, and probably would parse your file OK. I'll do some investigation in the next couple weeks for #269 btw thanks for the issue! |
of course, and thanks for actually maintaining this project lol. I think it wouldn't be too hard to have a list of reserved words like i mentioned and then just check the lines that appear in. if there is any line that has both I think that could be accomplished with some simple regexing and not require switchign from babylon to acorn |
This was a very interesting experience: 😆 Didn't think that would be valid. Anyhow, I think that doing the regexing dance is bad because of a few reasons:
Switching to a better parser seems like the right thing to do.
I don't think that there are different versions though? My test above was in Node.js 10 which supports ES2018 🤔 I think that |
Interesting test! Node seems to treat some reserved words different than others (this is with v8):
I think at some point, before classes were introduced to ES, you would have been able to say
I'll add some more thoughts in #269 |
I think that
|
I agree, I think this issue can be closed and that the proper solution is to switch the parser. |
When importing asyncawait as such:
const async = require('asyncawait').async; const await = require('asyncawait').await;
It says that asyncawait is an unused dependency.
The text was updated successfully, but these errors were encountered: