-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add browserslist options to the rule options #83
Add browserslist options to the rule options #83
Conversation
I've been trying it out - One problem is that the console logs now happen once per file. I could memoize getting the target rules, but then it still might flip-flop depending on the size of the memoize cache. any suggestions? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi. Looks like a sound change, and I think all your/my comments now have a path to being solved.
I'm afraid I've not spent any time maintaining this recently, but happy to review and release stuff.
I've not been using it myself for approaching two years, and I'm cautious about reading much into NPM download stats (mirrors, CI, etc. could account for a lot) for if many people actually use/need it.
packages/eslint-plugin-ecmascript-compat/lib/features/es2022.spec.js
Outdated
Show resolved
Hide resolved
06dc72d
to
6726aa9
Compare
@robatwilliams I've made the changes now. I resolve the comments, wasn't sure if I should do that or you. Let me know if there is anything else. |
We have a number of browserslist environments and would like some files to be scanned using one environment and some with another.
I can only achieve this by clearing the node cache and re-importing the rule.. Most browserslist tools allow you to pass the environment through.
I added the full API options to the eslint rule options for full flexibility.
I've also added a warning if the browsers list comes back empty - we had missed that when we introduced environments, the tool no longer did anything...
One gotcha with the es2022 test was that the rule tester seems to be async but returns void - so initially it didn't work because the environment variable is changed synchronously which works when re-importing the rule, but not when the testing is done async.. but the new options provide a neater way to test different configurations anyway.