diff --git a/.eslintrc.js b/.eslintrc.js index 32b5d16114941..670e790428867 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -84,7 +84,11 @@ module.exports = { "mocha/no-exclusive-tests": "error", // enforce the variable in a catch block is named error - "unicorn/catch-error-name": "error" + "unicorn/catch-error-name": "error", + + "no-restricted-imports": ["error", { + patterns: ["*Events"], + }] }, "overrides": [ { diff --git a/src/common/LifecycleWatcher.ts b/src/common/LifecycleWatcher.ts index bd64a5671a6ed..45ff97117a785 100644 --- a/src/common/LifecycleWatcher.ts +++ b/src/common/LifecycleWatcher.ts @@ -16,7 +16,6 @@ import { assert } from './assert'; import { helper, PuppeteerEventListener } from './helper'; -import { Events } from './Events'; import { TimeoutError } from './Errors'; import { FrameManager, Frame, FrameManagerEmittedEvents } from './FrameManager'; import { HTTPRequest } from './HTTPRequest'; diff --git a/src/common/Page.ts b/src/common/Page.ts index 63e1a40a4e663..41503a0a07b13 100644 --- a/src/common/Page.ts +++ b/src/common/Page.ts @@ -18,7 +18,6 @@ import * as fs from 'fs'; import { promisify } from 'util'; import { EventEmitter } from './EventEmitter'; import * as mime from 'mime'; -import { Events } from './Events'; import { Connection, CDPSession, CDPSessionEmittedEvents } from './Connection'; import { Dialog } from './Dialog'; import { EmulationManager } from './EmulationManager';