Merge pull request #17117 from Snuffleupagus/eslint-import-no-commonjs

Enable the `import/no-commonjs` ESLint plugin rule
This commit is contained in:
Tim van der Meij 2023-10-14 13:11:37 +02:00 committed by GitHub
commit 23b8dbb730
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 15 additions and 5 deletions

View File

@ -39,6 +39,7 @@
"import/named": "error",
"import/no-cycle": "error",
"import/no-empty-named-blocks": "error",
"import/no-commonjs": "error",
"import/no-mutable-exports": "error",
"import/no-self-import": "error",
"import/no-unresolved": ["error", {

View File

@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* eslint-disable import/no-commonjs */
//
// Basic node example that prints document metadata and text content.
//

View File

@ -12,6 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable import/no-commonjs */
const Canvas = require("canvas");
const assert = require("assert").strict;

View File

@ -1,6 +1,8 @@
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/licenses/publicdomain/
/* eslint-disable import/no-commonjs */
// Hello world example for webpack.
const pdfjsLib = require("pdfjs-dist");

View File

@ -1,3 +1,5 @@
/* eslint-disable import/no-commonjs */
const webpack = require("webpack"); // eslint-disable-line no-unused-vars
const path = require("path");

View File

@ -12,6 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable import/no-commonjs */
"use strict";

View File

@ -12,6 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable import/no-commonjs */
(typeof window !== "undefined"
? window

View File

@ -15,11 +15,9 @@
*/
/* eslint-disable no-var */
"use strict";
var assert = require("assert");
var fs = require("fs");
var vm = require("vm");
import assert from "assert";
import fs from "fs";
import vm from "vm";
var SRC_DIR = __dirname + "/../../";
var telemetryJsPath = "extensions/chromium/telemetry.js";

View File

@ -1,3 +1,5 @@
/* eslint-disable import/no-commonjs */
import { createRequire } from "module";
import fs from "fs";