-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Ignore usages that are part of feature test expressions #72
Comments
I think in order to reliably determine the method existence check, we need to analyze the code path and identify where the code is placed. I think it's very difficult to do, but if you have ideas please comment here or open a PR to add changes. if (String.prototype.replaceAll) {
// use replaceAll
}
if (!String.prototype.replaceAll) {
// use polyfill
} else {
// use replaceAll
}
if (typeof String.prototype.replaceAll !== 'undefined') {
// use replaceAll
}
if (typeof String.prototype.replaceAll === 'undefined') {
// use polyfill
} else {
// use replaceAll
}
a = String.prototype.replaceAll ? /* use replaceAll */ : /* use polyfill */; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If your code (or library code) is using a feature support test conditional statement before using a feature, then you still get an error reported by this plugin. It doesn't know your intent when doing such checks.
Could this plugin make guesses of reasonable confidence that statements like the following should not cause an error?
This issues arises from robatwilliams/es-compat#72
The text was updated successfully, but these errors were encountered: