From 00ce7898a24e9e97225c4571f284ba48d45ccac1 Mon Sep 17 00:00:00 2001 From: Takashi Tamura Date: Thu, 16 Jan 2020 13:32:11 +0900 Subject: [PATCH] Enable import/extensions of ESlint plugin to enforce all `import` have a `.js` file extension. Related to #11465. - https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md --- .eslintrc | 1 + src/shared/util.js | 2 +- web/firefoxcom.js | 2 +- web/genericl10n.js | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.eslintrc b/.eslintrc index a6c315c2d99de..1c5c977900069 100644 --- a/.eslintrc +++ b/.eslintrc @@ -31,6 +31,7 @@ "rules": { // Plugins + "import/extensions": ["error", "always", { "ignorePackages": true, }], "import/no-unresolved": "error", "mozilla/avoid-removeChild": "error", "mozilla/use-includes-instead-of-indexOf": "error", diff --git a/src/shared/util.js b/src/shared/util.js index 0584c6630634d..0777550bfcef5 100644 --- a/src/shared/util.js +++ b/src/shared/util.js @@ -14,7 +14,7 @@ */ /* eslint no-var: error */ -import "./compatibility"; +import "./compatibility.js"; const IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0]; const FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; diff --git a/web/firefoxcom.js b/web/firefoxcom.js index 83db636ce3c00..48703f83bcc73 100644 --- a/web/firefoxcom.js +++ b/web/firefoxcom.js @@ -13,7 +13,7 @@ * limitations under the License. */ -import "../extensions/firefox/tools/l10n"; +import "../extensions/firefox/tools/l10n.js"; import { createObjectURL, PDFDataRangeTransport, shadow } from "pdfjs-lib"; import { BasePreferences } from "./preferences.js"; import { DEFAULT_SCALE_VALUE } from "./ui_utils.js"; diff --git a/web/genericl10n.js b/web/genericl10n.js index dae376505ad81..d260e9be2eec3 100644 --- a/web/genericl10n.js +++ b/web/genericl10n.js @@ -13,7 +13,7 @@ * limitations under the License. */ -import "../external/webL10n/l10n"; +import "../external/webL10n/l10n.js"; const webL10n = document.webL10n;