-
-
Notifications
You must be signed in to change notification settings - Fork 300
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
chore: add eslint rule to restrict global fetch #6500
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## unstable #6500 +/- ##
=========================================
Coverage 61.72% 61.72%
=========================================
Files 555 555
Lines 58204 58206 +2
Branches 1843 1844 +1
=========================================
+ Hits 35926 35929 +3
+ Misses 22239 22238 -1
Partials 39 39 |
Performance Report✔️ no performance regression detected Full benchmark results
|
@@ -5,6 +5,7 @@ | |||
*/ | |||
async function wrappedFetch(url: string | URL, init?: RequestInit): Promise<Response> { | |||
try { | |||
// eslint-disable-next-line no-restricted-globals |
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.
Please add a comment here which explains why disabling this rule is important here. I believe that's the only place we need to use native fetch.
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.
I added a comment but obviously the function can't call itself, so I thought it is kinda self explanatory here
🎉 This PR is included in v1.17.0 🎉 |
Motivation
We should make sure that we don't accidentally use native fetch without error wrapper.
Description
Add eslint rule to restrict global fetch
Related #6497