-
-
Notifications
You must be signed in to change notification settings - Fork 353
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 no-unnecessary-polyfills
rule
#1717
Conversation
For |
7e40bb7
to
b1dffd2
Compare
Is this what you suggested? @zloirock |
@Mesteery for Object.keys(coreJsEntries).flatMap(it => (it.startsWith('core-js/actual/') && !/\/(virtual|instance)\//.test(it)) ? it.slice(15) : []) and operate with them like with |
Sorry, but I didn't quite understand that. |
For example, you have an import of |
Like this 707f4f2? |
Yes, something like that. |
707f4f2
to
3b61fc1
Compare
PTAL @fisker |
Sorry for the delay, I'll review ASAP. |
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.
Sorry for the long delay. Feel hard to review, I'll take another round later.
rules/no-unnecessary-polyfills.js
Outdated
} | ||
|
||
const {browserlist} = result.pkg; | ||
const nodeEngine = result.pkg.engines && result.pkg.engines.node && new SemverNodeVersion(result.pkg.engines.node); |
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.
Not every package.json have engine
field.
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.
Indeed, that is in case the targets
field is not defined in the config. If the engines
field is also undefined, the plugin is not executed.
The tests are failing. |
Fixed. The errors is due to |
Thanks you! Is it ready or i missed some changes? |
@Mesteery Bump |
716a9ea
to
430cf20
Compare
I'm sorry for all the delay, I was really busy. (btw, I don't know how to fix the markdown lint error) I have a doubt about one thing, I'm not sure if |
|
If I understand you want |
Bump |
I mean I don't know if core-js accept |
4b535e3
to
bb65c06
Compare
I apologize again for the delay. I've slightly refactored the code, and I passed |
CI is failing |
bdc43eb
to
3c7610d
Compare
3c7610d
to
31c289e
Compare
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Fixes: #36
IssueHunt Summary
Referenced issues
This pull request has been submitted to:
no-unnecessary-polyfills