-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Avoid no-floating-promises ESLint problem #11794
base: main
Are you sure you want to change the base?
Conversation
By the way, also happy to add a proper |
getLCP(onPerfEntry); | ||
getTTFB(onPerfEntry); | ||
}) | ||
.catch(() => {}); |
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.
This seems like a good fix for this issue but if there is a real error with the import it will be swallowed. Can you catch and log any error that might happen instead?
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.
Yep, for sure, I'll just use console.error
then
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.
Done in 39a4695
@iansu any further feedback on this PR? Do you think we could get it merged / released? |
An alternative to this PR is the following PR, which removes |
Hi there!
First of all, thanks for all the amazing work that goes into maintaining
create-react-app
andreact-scripts
. We've seen a lot of success with teaching it at @upleveled.Recently came across
@typescript-eslint/no-floating-promises
(from tweets like https://mobile.twitter.com/flybayer/status/1469098848958222337) and it has problems with the code inreportWebVitals.js
This avoids the issue without changing the functionality