diff --git a/extensions/firefox/content/PdfJsDefaultPreferences.jsm b/extensions/firefox/content/PdfJsDefaultPreferences.jsm index 41aadb980..4580e83d2 100644 --- a/extensions/firefox/content/PdfJsDefaultPreferences.jsm +++ b/extensions/firefox/content/PdfJsDefaultPreferences.jsm @@ -17,5 +17,6 @@ var EXPORTED_SYMBOLS = ["PdfJsDefaultPreferences"]; -var PdfJsDefaultPreferences = - Object.freeze(PDFJSDev.json("$ROOT/build/default_preferences.json")); +var PdfJsDefaultPreferences = Object.freeze( + PDFJSDev.json("$ROOT/build/default_preferences.json") +); diff --git a/extensions/firefox/tools/l10n.js b/extensions/firefox/tools/l10n.js index f3caa763f..96fdb0f5c 100644 --- a/extensions/firefox/tools/l10n.js +++ b/extensions/firefox/tools/l10n.js @@ -22,7 +22,7 @@ return text; } return text.replace(/\{\{\s*(\w+)\s*\}\}/g, function(all, name) { - return (name in args ? args[name] : "{{" + name + "}}"); + return name in args ? args[name] : "{{" + name + "}}"; }); } @@ -112,7 +112,7 @@ // use the short language code for "full" codes like 'ar-sa' (issue 5440) var shortCode = gLanguage.split("-")[0]; - return (rtlList.includes(shortCode) ? "rtl" : "ltr"); + return rtlList.includes(shortCode) ? "rtl" : "ltr"; }, getReadyState() { @@ -126,6 +126,6 @@ }, // translate an element or document fragment - translate: translateFragment, + translate: translateFragment }; })(this); diff --git a/package-lock.json b/package-lock.json index 568070134..febfb8d0e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2896,13 +2896,27 @@ "dev": true }, "dom-serializer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", - "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.1.tgz", + "integrity": "sha512-sK3ujri04WyjwQXVoK4PU3y8ula1stq10GJZpqHIUgoGZdsGzAGu65BnU3d08aTVSvO7mGPZUc0wTEDL+qGE0Q==", "dev": true, "requires": { - "domelementtype": "^1.3.0", - "entities": "^1.1.1" + "domelementtype": "^2.0.1", + "entities": "^2.0.0" + }, + "dependencies": { + "domelementtype": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.1.tgz", + "integrity": "sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ==", + "dev": true + }, + "entities": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.0.tgz", + "integrity": "sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw==", + "dev": true + } } }, "domain-browser": { @@ -3403,6 +3417,15 @@ "lodash.zip": "^4.2.0" } }, + "eslint-config-prettier": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.2.0.tgz", + "integrity": "sha512-VLsgK/D+S/FEsda7Um1+N8FThec6LqE3vhcMyp8mlmto97y3fGf3DX7byJexGuOb1QY0Z/zz222U5t+xSfcZDQ==", + "dev": true, + "requires": { + "get-stdin": "^6.0.0" + } + }, "eslint-import-resolver-node": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", @@ -3434,6 +3457,21 @@ } } }, + "eslint-plugin-fetch-options": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-fetch-options/-/eslint-plugin-fetch-options-0.0.5.tgz", + "integrity": "sha512-ZMxrccsOAZ7uMQ4nMvPJLqLg6oyLF96YOEwTKWAIbDHpwWUp1raXALZom8ikKucaEnhqWSRuBWI8jBXveFwkJg==", + "dev": true + }, + "eslint-plugin-html": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-html/-/eslint-plugin-html-6.0.0.tgz", + "integrity": "sha512-PQcGippOHS+HTbQCStmH5MY1BF2MaU8qW/+Mvo/8xTa/ioeMXdSP+IiaBw2+nh0KEMfYQKuTz1Zo+vHynjwhbg==", + "dev": true, + "requires": { + "htmlparser2": "^3.10.1" + } + }, "eslint-plugin-import": { "version": "2.18.2", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.18.2.tgz", @@ -3481,9 +3519,9 @@ } }, "eslint-plugin-mozilla": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-mozilla/-/eslint-plugin-mozilla-1.2.1.tgz", - "integrity": "sha512-i6SAWTPgKI6T50L6Gy41efR3StjPGR3IWkFOW/4aGsJtpl+OmJVaOmUfhp5PGis3ZbDisNvQ/vzLiNicAWC7nw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-mozilla/-/eslint-plugin-mozilla-2.1.0.tgz", + "integrity": "sha512-Fsu2kq3FZKgreXTew0UjArmnbGWnEnkgn21sojpuJ0GwUwI6T0Ee9MrMIeXiC0LhX6AkBtK+QkqQViw4sEgBZw==", "dev": true, "requires": { "htmlparser2": "3.10.1", @@ -3497,6 +3535,15 @@ "integrity": "sha512-JnwpoH8Sv4QOjrTDutENBHzSnyYtspdjtglYtqUtAHe6f6LLKqykJle+UwFPg23GGwt5hI3amS9CRDezW8GAww==", "dev": true }, + "eslint-plugin-prettier": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.0.tgz", + "integrity": "sha512-XWX2yVuwVNLOUhQijAkXz+rMPPoCr7WFiAl8ig6I7Xn+pPVhDhzg4DxHpmbeb0iqjO9UronEA3Tb09ChnFVHHA==", + "dev": true, + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, "eslint-plugin-unicorn": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-10.0.0.tgz", @@ -3820,6 +3867,12 @@ "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", "dev": true }, + "fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, "fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", @@ -4692,6 +4745,12 @@ "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", "dev": true }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + }, "get-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", @@ -5277,9 +5336,9 @@ }, "dependencies": { "readable-stream": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz", - "integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", + "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", "dev": true, "requires": { "inherits": "^2.0.3", @@ -10687,6 +10746,21 @@ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, + "prettier": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz", + "integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==", + "dev": true + }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "requires": { + "fast-diff": "^1.1.2" + } + }, "pretty-hrtime": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", diff --git a/package.json b/package.json index 2ab56d555..2e8808b91 100644 --- a/package.json +++ b/package.json @@ -14,9 +14,13 @@ "core-js": "^2.6.9", "escodegen": "^1.12.0", "eslint": "^6.2.2", + "eslint-config-prettier": "^6.2.0", + "eslint-plugin-fetch-options": "^0.0.5", + "eslint-plugin-html": "^6.0.0", "eslint-plugin-import": "^2.18.2", - "eslint-plugin-mozilla": "1.2.1", + "eslint-plugin-mozilla": "^2.1.0", "eslint-plugin-no-unsanitized": "^3.0.2", + "eslint-plugin-prettier": "^3.1.0", "eslint-plugin-unicorn": "^10.0.0", "fancy-log": "^1.3.3", "globals": "^11.12.0", @@ -33,6 +37,7 @@ "merge-stream": "^1.0.1", "mkdirp": "^0.5.1", "node-ensure": "^0.0.0", + "prettier": "^1.18.2", "rimraf": "^2.7.1", "streamqueue": "^1.1.2", "systemjs": "^0.21.6",