diff --git a/lib/browser/.eslintrc.json b/lib/browser/.eslintrc.json index 27d223a509..dab1dafc3f 100644 --- a/lib/browser/.eslintrc.json +++ b/lib/browser/.eslintrc.json @@ -18,4 +18,4 @@ } ] } -} \ No newline at end of file +} diff --git a/lib/common/.eslintrc.json b/lib/common/.eslintrc.json new file mode 100644 index 0000000000..42964484b5 --- /dev/null +++ b/lib/common/.eslintrc.json @@ -0,0 +1,23 @@ +{ + "rules": { + "no-restricted-imports": [ + "error", + { + "paths": [ + "electron", + "electron/main", + "electron/renderer" + ], + "patterns": [ + "./*", + "../*", + "@electron/internal/browser/*", + "@electron/internal/isolated_renderer/*", + "@electron/internal/renderer/*", + "@electron/internal/sandboxed_worker/*", + "@electron/internal/worker/*" + ] + } + ] + } +} diff --git a/lib/common/api/clipboard.ts b/lib/common/api/clipboard.ts index dd03b4f279..55f7958bc7 100644 --- a/lib/common/api/clipboard.ts +++ b/lib/common/api/clipboard.ts @@ -1,5 +1,6 @@ import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages'; +// eslint-disable-next-line no-restricted-imports import type * as ipcRendererUtilsModule from '@electron/internal/renderer/ipc-renderer-internal-utils'; const clipboard = process._linkedBinding('electron_common_clipboard'); diff --git a/lib/isolated_renderer/.eslintrc.json b/lib/isolated_renderer/.eslintrc.json new file mode 100644 index 0000000000..cb5f6cadaa --- /dev/null +++ b/lib/isolated_renderer/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "rules": { + "no-restricted-imports": [ + "error", + { + "paths": [ + "electron", + "electron/main" + ], + "patterns": [ + "./*", + "../*", + "@electron/internal/browser/*" + ] + } + ] + } +} diff --git a/lib/renderer/.eslintrc.json b/lib/renderer/.eslintrc.json new file mode 100644 index 0000000000..cb5f6cadaa --- /dev/null +++ b/lib/renderer/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "rules": { + "no-restricted-imports": [ + "error", + { + "paths": [ + "electron", + "electron/main" + ], + "patterns": [ + "./*", + "../*", + "@electron/internal/browser/*" + ] + } + ] + } +} diff --git a/lib/renderer/common-init.ts b/lib/renderer/common-init.ts index 4ceff37416..bfec34419d 100644 --- a/lib/renderer/common-init.ts +++ b/lib/renderer/common-init.ts @@ -1,4 +1,4 @@ -import { ipcRenderer } from 'electron'; +import { ipcRenderer } from 'electron/renderer'; import { ipcRendererInternal } from '@electron/internal/renderer/ipc-renderer-internal'; import type * as webViewInitModule from '@electron/internal/renderer/web-view/web-view-init'; diff --git a/lib/renderer/inspector.ts b/lib/renderer/inspector.ts index 346de2030e..8dd941d306 100644 --- a/lib/renderer/inspector.ts +++ b/lib/renderer/inspector.ts @@ -2,7 +2,7 @@ import { internalContextBridge } from '@electron/internal/renderer/api/context-b import { ipcRendererInternal } from '@electron/internal/renderer/ipc-renderer-internal'; import * as ipcRendererUtils from '@electron/internal/renderer/ipc-renderer-internal-utils'; import { webFrame } from 'electron/renderer'; -import { IPC_MESSAGES } from '../common/ipc-messages'; +import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages'; const { contextIsolationEnabled } = internalContextBridge; diff --git a/lib/renderer/web-frame-init.ts b/lib/renderer/web-frame-init.ts index 37225cfb34..ac4db7f9a7 100644 --- a/lib/renderer/web-frame-init.ts +++ b/lib/renderer/web-frame-init.ts @@ -1,4 +1,4 @@ -import { webFrame, WebFrame } from 'electron'; +import { webFrame, WebFrame } from 'electron/renderer'; import * as ipcRendererUtils from '@electron/internal/renderer/ipc-renderer-internal-utils'; import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages'; diff --git a/lib/sandboxed_renderer/.eslintrc.json b/lib/sandboxed_renderer/.eslintrc.json new file mode 100644 index 0000000000..cb5f6cadaa --- /dev/null +++ b/lib/sandboxed_renderer/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "rules": { + "no-restricted-imports": [ + "error", + { + "paths": [ + "electron", + "electron/main" + ], + "patterns": [ + "./*", + "../*", + "@electron/internal/browser/*" + ] + } + ] + } +} diff --git a/lib/worker/.eslintrc.json b/lib/worker/.eslintrc.json new file mode 100644 index 0000000000..cb5f6cadaa --- /dev/null +++ b/lib/worker/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "rules": { + "no-restricted-imports": [ + "error", + { + "paths": [ + "electron", + "electron/main" + ], + "patterns": [ + "./*", + "../*", + "@electron/internal/browser/*" + ] + } + ] + } +}