Update Prettier to version 2.0

Please note that these changes were done automatically, using `gulp lint --fix`.

Given that the major version number was increased, there's a fair number of (primarily whitespace) changes; please see https://prettier.io/blog/2020/03/21/2.0.0.html
In order to reduce the size of these changes somewhat, this patch maintains the old "arrowParens" style for now (once mozilla-central updates Prettier we can simply choose the same formatting, assuming it will differ here).
This commit is contained in:
Jonas Jenwald 2020-04-14 12:28:14 +02:00
parent a4dd081d7b
commit 426945b480
145 changed files with 2005 additions and 2009 deletions

View file

@ -164,7 +164,7 @@ function scrollIntoView(element, spot, skipOverflowHiddenElements = false) {
* PDF.js friendly one: with scroll debounce and scroll direction.
*/
function watchScroll(viewAreaElement, callback) {
const debounceScroll = function(evt) {
const debounceScroll = function (evt) {
if (rAF) {
return;
}
@ -564,7 +564,7 @@ function getVisibleElements(
last = visible[visible.length - 1];
if (sortByVisibility) {
visible.sort(function(a, b) {
visible.sort(function (a, b) {
const pc = a.percent - b.percent;
if (Math.abs(pc) > 0.001) {
return -pc;
@ -705,7 +705,7 @@ const WaitOnType = {
* @returns {Promise} A promise that is resolved with a {WaitOnType} value.
*/
function waitOnEventOrTimeout({ target, name, delay = 0 }) {
return new Promise(function(resolve, reject) {
return new Promise(function (resolve, reject) {
if (
typeof target !== "object" ||
!(name && typeof name === "string") ||
@ -742,7 +742,7 @@ function waitOnEventOrTimeout({ target, name, delay = 0 }) {
/**
* Promise that is resolved when DOM window becomes visible.
*/
const animationStarted = new Promise(function(resolve) {
const animationStarted = new Promise(function (resolve) {
if (
typeof PDFJSDev !== "undefined" &&
PDFJSDev.test("LIB && TESTING") &&
@ -828,7 +828,7 @@ class EventBus {
let externalListeners;
// Making copy of the listeners array in case if it will be modified
// during dispatch.
eventListeners.slice(0).forEach(function({ listener, external }) {
eventListeners.slice(0).forEach(function ({ listener, external }) {
if (external) {
if (!externalListeners) {
externalListeners = [];
@ -841,7 +841,7 @@ class EventBus {
// Dispatch any "external" listeners *after* the internal ones, to give the
// viewer components time to handle events and update their state first.
if (externalListeners) {
externalListeners.forEach(function(listener) {
externalListeners.forEach(function (listener) {
listener.apply(null, args);
});
externalListeners = null;