-
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
Improve ES5 detection #11
Comments
@cdeutsch You're most welcome 🙏 , so if something is not detected it's either because of #2 (which I'm not sure how to handle yet) or because acorn didn't detect it. At the moment, all this package does is check against the entrypoint file defined in a package's It looks like
'use strict';
module.exports = str => encodeURIComponent(str).replace(/[!'()*]/g, x => `%${x.charCodeAt(0).toString(16).toUpperCase()}`); and that's definitely not ES5. I'll give that one a quick look (Acorn should've detected this) and investigate numbro more. |
So I tried adding these dependencies locally and this is the output I got:
It did properly detect that |
Does If so, that would explain why I don't see Not sure, what's wrong with I think you can close this. |
Yes only direct dependencies at the moment. I was also not sure if we needed to go beyond that, direct dependencies served my use-case. If another package includes |
Looks like query-string is the NPM in my project that requires
So, yes, I'd throw an error. And it looks like even if Side note: It looks like if I just replaced the @sindresorhus modules |
I'll do some more testing and try and find a solution that helps users of this package get a regex that works for all cases. I think as a start I'll produce separate output for dependencies of dependencies and add a flag to include those in the ignore regex. Do you think we should go beyond checking the entry files for dependencies of dependencies (e.g. check the whole directory), or is checking the entry file enough? I'll probably also add some form of caching to avoid double-checking a package (e.g. if two packages require |
I would lean towards checking the whole |
I thought of that but I want to avoid it as much as possible because it would make this package incredibly slow, but I'll definitely consider it as a flag. |
Follow up on It was my fault. I was importing the language files from |
@cdeutsch I released version 1.2.0 with support for checking all |
When I run with:
I get the error:
|
Oh that's probably because I didn't ignore |
As mentioned in #11 even though we were ignoring `.bin`, `.cache` was falling through our check and we should actually ignore any node_modules folder that starts with a `.` because there are no packages/organizations that start with a `.`
@cdeutsch I published version 1.2.1 which ignores all |
Seems to work. Thanks 👍 |
Found a few NPMs that aren't detected:
Not sure if there is a better way to do the detection?
Maybe running a linting tool?
My company still supports IE11, so grateful for a tool like this 👍
The text was updated successfully, but these errors were encountered: