From 4f243b85f0e2de495c51c337987e0860aeee8472 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 a6c315c2d99def..975b1a798a9145 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 0584c6630634dd..0777550bfcef5c 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 83db636ce3c00f..48703f83bcc731 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 dae376505ad81c..d260e9be2eec3b 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;