-
Notifications
You must be signed in to change notification settings - Fork 195
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
Fix ESLint warnings #2252
Fix ESLint warnings #2252
Conversation
There's no refence element to get the window object that's why the rule is being disabled instead.
@@ -28,9 +28,12 @@ const useConfirmNavigation = ( displayPrompt ) => { | |||
event.preventDefault(); | |||
event.returnValue = ''; | |||
}; | |||
|
|||
// eslint-disable-next-line @wordpress/no-global-event-listener |
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'm disabling the rule here in the next line as there's no element that we can use to get the defaultView
object.
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.
As some people have asked in the PR where the rule was introduced, I'm also not familiar as to why this warning is important. It looks a bit overkill to me - not judging the specific change, but the need for it 🤔. What do you think @asumaran and @harriswong?
Perhaps not even worth discussing as this only applies for 2 files 😅.
The change LGTM 👍.
Hi @asumaran @ricardo , sorry for the late reply! I am good with the I think the idea was to prevent the use of listener on |
@harriswong Thanks for the recommendation. I've created an issue #2270 to update our |
Fixes a few ESLint warnings that were being displayed by GitHub on PRs - Here's one example.