-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Convert the find bar to ES6 syntax #8297
Conversation
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/6648ebfac6ca87f/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/6648ebfac6ca87f/output.txt Total script time: 3.08 mins Published |
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.
Looks good, thank you!
r=me, with one nit.
web/pdf_find_bar.js
Outdated
dispatchEvent(type, findPrev) { | ||
this.eventBus.dispatch('find', { | ||
source: this, | ||
type: type, |
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.
Nit: Since you're touching this line anyway, please note that it can be simplified to just type,
Please note: The object-shorthand
ESLint rule would catch this, but given the vast number of failures it's not really feasible to enable it right now.
However, if we try to convert cases like these when we touch the code anyway, it might be slightly more doable later on (for reference, see also this MDN article).
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 the new commit. I'm adding it to my list of things to think about when converting to ES6 👍
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.
Just a small suggestion: If you're using an editor which has support for plugins, I'd highly suggest enabling a linting/ESLint plugin.
Personally, I've found it immensely helpful to be able to get linting results directly in the editor on a file-by-file basis, and that way you can temporarily enable https://github.com/mozilla/pdf.js/blob/master/.eslintrc#L157 to help catch these cases.
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 using Vim. I think I had it a while ago when we used JSHint, but for some reason I never added it again for ESLint. I just did and it's indeed really helpful to see any errors/warnings in the editor. Thank you for the suggestion!
f3bc1b5
to
6f6fb4d
Compare
/botio-windows preview |
From: Bot.io (Windows)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.215.176.217:8877/4a986eb4c9ae654/output.txt |
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/4a986eb4c9ae654/output.txt Total script time: 22.25 mins Published |
Convert the find bar to ES6 syntax
Easier reviewing with https://github.com/mozilla/pdf.js/pull/8297/files?w=1.